What do you mean, MD5 SHA1 CRC32? What is the main difference?

Source: Internet
Author: User
Tags crc32 md5 sha1
What is MD5, what is SHA-1, and how to verify these hashes. There is a single ISO document MD5,SHA-1 interrogation is not the original question, here, to do a final explanation of the above problems.

Let's take a look at some basic knowledge about hash.

Hash, the general translation to do "hash", there is a direct transliteration to "hash", is the arbitrary length of the input (also known as the pre-image), through hashing algorithm, transform into a fixed length of output, the output is hash value. This conversion is a compression map, in which the space of the hash value is usually much smaller than the input space, and different inputs may be hashed out into the same output, and it is not possible to uniquely determine the input value from the hash value.

Simply put, a function that compresses messages of any length into a message digest of a fixed length.

Hash is mainly used in the field of information security encryption algorithm, he has a number of different lengths of information into a cluttered 128-bit code, called the hash value. It can also be said that the hash is to find a kind of data content and data storage address between the mapping relationship

Understanding the basic definition of hash, we can not but mention some well-known hash algorithm, MD5 and SHA1 is the most widely used hash algorithm, and they are based on the MD4 design. So what do they all mean?

Here's a quick word:

1) MD4

MD4 (RFC1320) was designed by MIT's Ronaldl.rivest in 1990, and MD is the abbreviation for messagedigest. It is implemented on a 32-bit word processor with high-speed software-it is based on a bit operation of 32-bit operands.

2) MD5

MD5 (RFC1321) is an improved version of Rivest in 1991 for MD4. The input is still grouped with 512 bits, and its output is a cascade of 4 32-bit characters, same as MD4. MD5 is more complex than MD4, and slower, but safer, and better at resistance to analysis and differentiation.

MD5 is an irreversible encryption algorithm, is currently one of the most reliable encryption algorithm, there is no inverse operation of the program was developed, it corresponds to any string can be encrypted into a unique fixed length of code.

So what's the use of it? Quite simply, it allows you to determine whether the original value is correct (whether it has been changed). Generally used for encryption of passwords. and the MD5 check code we provide is the only corresponding piece of code for the installer. You can use any MD5 operator to calculate the downloaded file, if the result of the operation is fully in line with the MD5 check code, then you download the program has not been modified in midstream.

This signature has the following characteristics, first of all, it is irreversible, for example, I have a secret text such as: "Mysecretwords", the algorithm after the transformation of the MD5 Code (B9944E9367D2E40DD1F0C4040D4DAAF7), the code to tell other people, They are based on this MD5 code is no systematic way to know what your original text is.

Second, the code is highly discrete, that is, a little change in the original information can lead to MD5 changes, such as "ABC" MD5 (902fbdd2b1df0c4f70b4a5d23525e932) and "ABC" (One More space) MD5 ( 12c774468f981a9487c30773d8093561) The difference is very large, and there is no relationship between, that is, the resulting MD5 code is unpredictable.

Finally, because the code is 128 bits long, the possibility of having the same MD5 code between arbitrary information is very low and is often considered impossible.

Therefore, it is generally believed that MD5 code can uniquely represent the characteristics of the original information, usually used for cryptographic storage of passwords, digital signatures, file integrity verification and so on.

3) SHA1 and others

The SHA1 is designed by Nistnsa to work with DSA, which produces a hash value of 160bit for length less than 264, and therefore has a better anti-poor lift (Brute-force). The SHA-1 design is based on the same principle as the MD4 and imitates the algorithm. SHA-1, a national standard promulgated by the United States Standards Technology Agency (NIST), is one of the most widely used hash function algorithms and the most advanced encryption technology currently used by government departments and private owners to handle sensitive information. and SHA-1 based on MD5,MD5 and MD4.

The forum provides the system image file hash is the Microsoft official provides the SHA-1 value, after downloading and this value correspondence, explained that you download the document has not been changed, belongs to the original.

What is CRC

CRC is called Cyclicredundancycheck, the Chinese name is cyclic redundancy check. It is a kind of important linear block code, encoding and decoding method is simple, error detection and error correction ability, in the field of communication widely used to achieve error control. In fact, in addition to data communications, CRC in many other areas is also useful. For example, we read the files on the floppy disk, and extract a zip file, occasionally encounter "BADCRC" error, which in the application of data storage can be seen.

So what's the use of these hash algorithms?

The application of hash algorithm in information security is mainly embodied in the following 3 aspects:

1) File verification

We are familiar with parity check algorithm and CRC checksum, these 2 kinds of checksums do not have the ability to tamper with data, they can detect and correct the channel error in data transmission to some extent, but can not prevent malicious damage to the data.

The "digital fingerprint" feature of Md5hash algorithm makes it become one of the most widely used file integrity checksum (Checksum) algorithms, and many UNIX systems have the command to provide computational md5checksum.

2) Digital Signature

Hash algorithm is also an important part of modern cryptography system. Because of the slow operation speed of the asymmetric algorithm, the one-way hash function plays an important role in the digital signature protocol. The hash value, also known as a "digital digest", is digitally signed and can be considered to be statistically equivalent to the digital signature of the file itself. And there are other advantages to such an agreement.

3) Authentication Agreement

The following authentication protocol is also known as the "Challenge-authentication mode: This is a simple and secure way to be able to be listened to, but not tamper with, a transmission channel."

Of course, the hash function is not completely reliable, different files to produce the same MD5 and SHA1 probability or some, but not high, in our forum to provide the system CD, you want to have a few files with the same hash of different files is simply impossible.

The Forum MSDN section, which offers Microsoft's release of the hash value--sha-1 of the Windows system provided to programmers for research, does not provide MD5 because Microsoft only offers SHA1. And the Mirror of the Forum publishing area is the mirror that corresponds to these values, you verify the hash of your mirror and the corresponding version of the MSDN information area corresponding to the SHA-1, that the CD in your hand is the original disk that Microsoft publishes through MSDN. There is also the possibility of a mirror that is published in retail or through a sales channel. After all, MSDN is just a way for Microsoft to release the System CD, and MSDN is just for developers to work with.

To seek the original confirmation, corresponding to SHA-1 and MD5, CRC certification is also a very important factor, CRC is also verifying the integrity of the file, as well as the CDIMGE package version.

Microsoft produced a mirror can be verified by CRC, of course, some people use CRC to make their own to get through the CRC Mirror, then you need to correspond to the mirror of the SHA-1, so, verify that a mirrored original disk can be completed by a number of corresponding values.

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.