/* Des Java
Complied OK with eclipse
Create a desencrypt class, copy the following code, and compile it.
*/Import java. Security. Key;Import java. Security. securerandom;Import javax. crypto. cipher;Import javax. crypto. keygenerator;
Import sun. Misc. base64decoder;Import sun. Misc. base64encoder;
/**** Use des to encrypt and decrypt byte [] and string types.* The ciphertext can be stored using string, byt
In php5.x, add the php extension php_mcrypt.
PHP version:
Copy codeThe Code is as follows:Class STD3Des{Private $ key = "";Private $ iv = "";/*** Construct and pass two keys and IV that have been base64_encode** @ Param string $ key* @ Param string $ iv*/Function _ construct ($ key, $ iv){If (empty ($ key) | empty ($ iv )){Echo 'key and iv is not valid ';Exit ();}$ This-> key = $ key;$ This-> iv = $ iv;}/*** Encryption* @ Param * @ Return */Public fun
Copy Code code as follows:
Paul Tero, July 2001.
http://www.tero.co.uk/des/
//
Optimised for performance with large blocks by Michael Hayworth, November 2001
Http://www.netdealing.com
//
This SOFTWARE is provided ' as is ' and
Any EXPRESS OR implied warranties, including, BUT not LIMITED to, the
Implied warranties of merchantability and FITNESS for A particular purpose
ARE disclaimed. In NO EVENT SHALL the AUTHOR OR CONTRIBUTORS to be l
Here is an example of a des CBC-based encryption form that I've tuned based on the STM32+POLARSSL encryption library. So that you can use it to do the right thing.
1. Use the DES-CBC encryption method and populate it with the Pkc
This article mainly introduces the des encryption and decryption code sharing that is compatible with PHP and Java. it is suitable for cases where the server is written in JAVA and the client is written in PHP and des encryption and decryption is required, for more information about php code, see:
Java code:
Package
PHP implementation and C # consistent DES encryption decryption, can be searched from the internet to a large heap, but the test found no use. The following are the correct codes that I found after a hard struggle. I hope you can use it when the system is integrated.Note: The length of the key is within 8 bits.C # version des plus decryption algorithm using Syste
Weaknesses:The communication password is entered continuously and encrypted two times.The communication password is artificially selected.An IDF code book must be distributed.3rd. Symmetric passwordencoding : An operation that maps something in the real world to a sequence of bits becomes encoded.XOR: XOR operation, same as 0 xor, 0xor0=0,0xor1=1,1xor0=1,1xor1=0the nature of the XOR : A xor or B XOR B is a.One-time password book-the password that will never be decipheredDefinition: XOR the plai
This article mainly introduces the implementation of PHP and C # consistent DES encryption and decryption instance, has a certain reference value, now share to everyone, the need for friends can refer to
PHP implementation and C # consistent DES encryption decryption, can be searched from the internet to a large heap,
The following small series for everyone to bring a PHP implementation and C # consistent DES encryption and decryption instance. Small series feel very good, now share to everyone, also for everyone to make a reference. Let's take a look at it with a little knitting.
PHP implementation and C # consistent DES encryption
/// ///des encryption Algorithm///Skey is 8-bit or 16-bit/// /// strings that need to be encrypted /// secret key /// Public Static stringDESENCRYPTSTR (stringPtoencrypt,stringSKey) {StringBuilder ret=NewStringBuilder (); DESCryptoServiceProvider des=NewDESCryptoServiceProvider (); byte[] Inputbytearray =Encoding.Defaul
=NewBase64decoder (); the byte[] B =Decoder.decodebuffer (s); - returnb; $ } the the Public Static voidMain (string[] args)throwsException { theString key = "ABCDEFGH"; theString input = "a"; -Des crypt =NewDes (key); inSystem.out.println ("Encode:" +crypt.encrypt (input)); theSystem.out.println ("Decode:" +Crypt.decrypt (Crypt.encrypt (input))); the } About}Today is my mother's birthday, I am grateful that
The. NET core of Des and other encryption algorithms to wait until 1.2 to support, we urgently need the support of this algorithm, the article "Using Javascriptservice in. NET core implementation des encryption algorithm" needs to use Nodejs, many people think this is a little bad, Today we will introduce the Bouncycas
As a web front-end application, communication with the server or back-end communication, as well as the transfer of data between different users, in some specific cases need to encrypt some information transmission, in an event to remove information and decryption, get the correct information. Looking at different languages and different algorithms, there are many options. Today, from the most basic encryption and decryption algorithm
Reprint please indicate source: http://www.cnblogs.com/gexun/p/3705207.html, thank you.These days have been doing a knowledge question and answer project, because the preliminary project topic is relatively small, so the title is written in the local plist file, directly read it.The company PM worry about the problem leaked, so we have to give plist file encryption, this can put me disabled, because I have never done
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.