Job Recruitment Website - Zhaopincom - Encryption Technology 04- Hash Algorithm -MD5 Principle

Encryption Technology 04- Hash Algorithm -MD5 Principle

MD5 Message-Digest Algorithm (English: MD5 Message-Digest Algorithm) is a widely used cryptographic hash function, which can generate a hash value of 128 bits (16 bytes, expressed as a 32-bit hexadecimal number) to ensure the integrity and consistency of information transmission. MD5 was designed by American cryptographer Ronald Linn Rivest and published in 1992 to replace MD4 algorithm. The program of this algorithm is standardized in RFC 132 1.

The basic principle of hash algorithm is to change data (such as a paragraph of text) into another fixed-length value.

Note: MD5 does not require the length of the message.

There are two general rules for the arrangement of bytes.

For example, to store the binary value 16 0x 12345678, 4 bytes are needed, and the memory address of the storage byte grows in the following direction.

Big-end storage: 0x 12 0x34 0x56 0x78

Small end storage: 0x78 0x56 0x34 0x 12

After 1996, it is proved to have weaknesses and can be cracked. For materials requiring high security, experts generally recommend using other algorithms, such as SHA-2. In 2004, MD5 algorithm was proved to be unable to prevent collision attacks, so it is not suitable for security authentication, such as SSL public key authentication or digital signature.

In 2009, Xie Tao and Feng Dengguo of Chinese Academy of Sciences cracked the anti-collision performance of MD5 with a collision algorithm complexity of 2 20.96. The attack only takes a few seconds to run on a common computer. In 20 1 1, RFC 6 15 1 prohibits MD5 from being used as an authentication code for key hash messages.

There are generally two numbers after MD5 hash, 16 and 32. 16 bit is actually the part from the 9th bit to the 24th bit in the middle of a 32-bit string.

MD5 32(" 123 123 ")= " 4297 f44b 13955235245 b 2497399 d7a 93 "

MD5 16(" 123 123 ")= " 13955235245 b 2497 "