Current location - Quotes Website - Personality signature - How many bits are output by MD5, sha 1 and sha256 respectively?
How many bits are output by MD5, sha 1 and sha256 respectively?
MD5 SHA 1 SHA256? These three essences are abstract functions. What are their lengths? MD5 is 128, SHA 1? Is it 160, SHA256? It is 256.

MD5 processes the input information in 5 12-bit packets, and each packet is divided into 16 32-bit packets. After a series of processing, the output of the algorithm consists of four 32-bit data packets, which will generate a hash value of 128 bits after concatenation.

SHA 1 will generate a message digest of 160 bits for messages with a length of less than 2 64 bits. When a message is received, the message digest can be used to verify the integrity of the data.

Hash values are used as unique values representing a fixed size of a large amount of data. A small change in data will produce a large number of unpredictable hash value changes. The hash value of SHA256 algorithm is 256 bits.

Extended data

Application of MD5 algorithm;

1, consistency verification

MD5 can generate the same unique "digital fingerprint" for any file, regardless of its size, format and quantity. If someone makes any changes to the file, its MD5 value, that is, the corresponding "digital fingerprint", will change.

The scheme of checking files with MD5 algorithm is widely used in software download station, forum database, system file security and so on.

2. Digital signature

The typical application of MD5 is to generate fingerprints for messages (byte strings) to prevent them from being tampered with.

For example, if you write a paragraph in a file named readme.txt and generate an MD5 value for this readme.txt and record it, then you can spread this file to others. If someone else modifies anything in the file, when you recalculate the MD5 of this file (the two MD5 values are different), you will find that.

If there is a third-party certification authority, MD5 can also prevent the "denial" of the document author, which is the so-called digital signature application.

3. Secure access authentication

MD5 is also widely used in login authentication of operating systems, such as Unix, login passwords of various BSD systems, digital signatures and many other aspects. For example, in a Unix system, the user's password is hashed with MD5 (or other similar algorithm) and stored in the file system.

References:

Baidu encyclopedia -SHA256

References:

Baidu encyclopedia -SHA 1

References:

Baidu Encyclopedia -MD5