) 0x0000ffff;
keys[n++] = lefttemp ^ temp; keys[n++] = righttemp ^ (temp }
}//for each iterations
Return the keys we ' ve created
return keys;
}//end of Des_createkeys
TEST//////////////////////////////
function Stringtohex (s) {
var r = "0x";
var hexes = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "B", "C", "D", "E", "F");
for (var i=0 ireturn R;
}
function hextostring (h) {
var r = "";
For (Var i= (h.substr (0, 2) = = "0x")? 2:0 ireturn R;
}
var
the Java classes involved in DES encryption decryption
Cipher
This class provides password functionality for encryption and decryption. It forms the core of the Java cryptographic Extension (JCE) framework .To create the Cipher object, the application invokes the Cipher getinstance method and passes the name of the requested transformation to it. You can also s
, replacement, and shift operations.3DES
A common variant of DES is threefold des, a mechanism that uses a 168-bit key to encrypt data three times; it generally (but not always) provides extremely powerful security. If the three 56-bit sub-elements are the same, the Triple DES is backward compatible with DES.Features
, 0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000, 0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000, 0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000, 0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000);
Create the or subkeys we'll need
var keys = Des_createkeys (key);
var m=0, I, J, temp, Temp2, right1, right2, left,
Download and introduction Address: https://twhiteman.netfirms.com/des.htmlIf you need to use DES encryption in Python, you can use Pydes library encryption directly, which provides CBC and ECB two encryption methods.1. Install under WindowsAfter download Pydes-x.x.x.zip and unzip, there is setup.py file, use the comman
This article illustrates the simple method of implementing DES encryption and decryption by PHP. Share to everyone for your reference, specific as follows:
DES encryption:
function Des_encrypt ($STR, $key) {
$block = mcrypt_get_block_size (' des ', ' ECB ');
$pa
Label:Des_decrypt (Crypt_str[,key_str])Use Des_encrypt () to encrypt a string. If an error occurs, this function returns NULL.Note that this function will only work if MySQL is configured with SSL support. See section 5.8, 7, "Using a secure connection".Without a given key_str parameter, Des_decrypt () first checks the first byte of the encrypted string to determine the number of DES cipher keys used to encrypt the original string, and then reads the
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
Recently done web data encryption work, using Cryptojs v3.1.2 this JavaScript script, online comparison of the quality of the article is too little, verified that the results of encryption and ASP Net DES encryption results consistentReference articleshttps://gist.github.com
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
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
This article mainly introduces the JavaScript implementation des decryption encryption process, the need for friends can refer to the following The code is as follows://paul Tero, July 2001nbsp;//http://www.tero.co.uk/des/nbsp;//nbsp;, for//optimised with performance large Cks by Michael Hayworth, November 2001nbsp;//http://www.netdealing.comnbsp;//nbsp;//this
Recently, there is a new project to do with Java, the old project is ASP, interface transmission needs des plus decryption, online search of some information, most can not be used, after debugging and processing, the specific code is as follows:The key must be 8 bits. The corresponding Java method is as follows:Package com.testspring;Import Javax.crypto.Cipher;Import Javax.crypto.SecretKey;Import Jav
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
Based on the analysis in the previous article "Introduction to Real Data Encryption Using DES (analysis)", Java can be used to encrypt strings, however, the legacy problem is that the string cannot be decrypted, because after the encrypted byte array is converted into a string, it will be different from the original byte array, and there will be fewer digits, I don't know why. Isn't a one-to-one conversion
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.