AES 3DES MD5 Base64 Difference

Source: Internet
Author: User
Tags base64 character set hash md5 uppercase letter

AES encrypted block packet length must be 128 bits, the key length can be 128 bits, 192 bits, 256 bits of any one (if the data block and key length is insufficient, will be filled).


3DES, also known as Triple DES, is a mode of DES encryption algorithm that uses 3 56-bit keys to encrypt data three times. Data Encryption Standard (DES) is a long-standing encryption standard in the United States that uses symmetric key cryptography. Des uses a 56-bit key and cipher block method, and in the Cipher block method, the text is divided into 64-bit-sized blocks of text and then encrypted. More secure than the original des,3des. 3DES (i.e. Triple DES) is an encryption algorithm for DES-to-AES transitions. The 3DES algorithm refers to the use of a double-length (16-byte) key k= (kl| | KR) 3 des encryption/decryption of 8-byte plaintext data blocks.



The BASE64 encoding----converts 8-bit non-English characters to 7-bit ASCII characters. A) All binaries can therefore be converted to printable text encoding and edited using text software;
b) The ability to encrypt text simply. The so-called Base64, that is to choose 64 characters----lowercase letter A-Z, uppercase letter A-Z, number 0-9, the symbol "+", "/" (plus the "=" as the pad word, is actually 65 characters)----as a basic character set. All other symbols are then converted to the characters in this character set. Because Base64 converts three bytes into four bytes, Base64 encoded text will be one-third or so larger than the original text.

To give a Chinese example, how to convert the Chinese character "Yan" into Base64 code.
It is important to note that the kanji itself can have many encodings, such as gb2312, Utf-8, GBK, and so on, each of the Base64 corresponding values of the code is different. The following example takes Utf-8 as an example.
First, the Utf-8 code for "Strict" is e4b8a5, written in binary is three bytes of "11100100 10111000 10100101". Convert this 24-bit binary string to the four set of 32-bit binary values "00111001 00001011 00100010 00100101", according to the Rules in section 3rd, with the corresponding decimal numbers 57, 11, 34, 37, their corresponding Base64 values being 5, L, I, L.
Therefore, the Chinese character "strict" (Utf-8 code) Base64 value is 5Lil.


MD5 is message-digest algorithm 5 (Information-Digest algorithm 5), which is used to ensure complete and consistent information transmission. is one of the widely used hashing algorithms (also translation digest algorithm, hashing algorithm), mainstream programming language has been widely MD5 implemented. The calculation of data (such as Chinese characters) to another fixed length value, is the basis of the hashing algorithm, the MD5 algorithm has the following characteristics: 1, compressibility: Any length of data, the calculated length of the MD5 value is fixed. 2, easy to calculate: It is easy to calculate the MD5 value from the original data. 3, anti-modification: Any changes to the original data, even if only 1 bytes modified, the resulting MD5 value is very different. 4, strong anti-collision: known raw data and its MD5 value, it is very difficult to find a data with the same MD5 value (that is, falsification of data). MD5 's role is to allow bulk information to be "compressed" into a confidential format before signing a private key with a digital signature software (that is, converting an arbitrary-length byte string into a long hexadecimal string) specifically, the MD5 value of the file is like the "digital fingerprint" of the file. The MD5 value of each file is different, and if anyone makes any changes to the file, its MD5 value is the corresponding "digital fingerprint" will change. For example, the download server pre-provides a MD5 value for a file, after the user downloaded the file, using my algorithm to recalculate the MD5 value of the downloaded file, by comparing the two values are the same, you can determine whether the downloaded file is wrong, or whether the downloaded file has been tampered with.

MD5 for conformance authentication, digital signature, secure access authentication

MD5 map any length of "byte string" to a large integer of 128bit, and it is difficult to reverse the original string through the 128bit, in other words, even if you see the source program and algorithm description, you can not transform a MD5 value back to the original string, mathematically speaking, This is because the original string has an infinite number, which is somewhat like a mathematical function that does not have an inverse function. Therefore, to encounter the problem of MD5 password, the better way is: You can use the MD5 () function in this system to reset a password, such as admin, the generated hash of a string of passwords to overwrite the original hash value on the line.




Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.