Application MD5 algorithm

Application MD5 algorithm

Generate summary information
  A typical application is to generate the MD5 message digest (Message-Digest) of a piece of information (Message), to prevent tampering. For example, there is a lot of software under UNIX have a file with the same name when downloaded, the file extension of the file name .md5, in this file is usually only one line of text, such as the general structure:

  MD5 (tanajiya.tar.gz) = 0ca175b9c0f726a831d895e269332461

  This is the digital tanajiya.tar.gz file signature. MD5 entire file as a large text message, through its irreversible string transform algorithm, resulting in the unique MD5 message digest. In order for readers to use the MD5 have an intuitive understanding, the author of an analogy and an example to briefly describe their work:

  We all know that anyone on Earth has its own unique fingerprint , which often become the public security organs to identify the identity of the offender's most trusted method; Similarly, MD5 can be any document that (regardless of its size, format, quantity) to produce a also unique " digital fingerprint " that if anyone made any changes to the file, its MD5 value is the corresponding "digital fingerprint" will change.

  We often see the MD5 value of a certain software information software download sites, its role is that we can after downloading the software, download the file back to do once with specialized software (such as Windows MD5 Check, etc.) MD5 checksum to make sure we get the files provided by the site for the same file. File using the MD5 algorithm to verify the program is applied to a large number of software download site, forum database, the system file security.

 

Generating a fingerprint of a string of bytes
  A typical application is to generate the MD5 Fingerprint (fingerprint) for a period of Message (byte string), in order to prevent "tampering." For example, you will write a paragraph in a file called readme.txt, and this readme.txt generate a MD5 value and record, then you can spread the file to someone else, someone else if you modify the file Nothing, you will find (two MD5 values ​​are not the same) when you recalculate the MD5 of the file. If we have a third-party certification body, can also prevent files with MD5 author of "denial", which is the so-called digital signature applications.
 
Login authentication
  MD5 is also widely used operating system on the login authentication, such as Unix, all kinds of BSD systems login password, digital signature, and many other parties. The UNIX system user's password is the MD5 (or other similar algorithms) after the Hash operation stored in the file system. When a user logs in, the system password entered by the user MD5 Hash operation, and then go and MD5 value stored in the file system are compared, and then determine whether the correct password is entered. Through such steps, the system does not know the codes in case the user's password can determine the legitimacy of the user logged into the system. This prevents the user's password is user with system administrator privileges to know. The MD5 "byte string" arbitrary length 128bit mapped to a large integer, and by the thrust reverser 128bit original string is difficult, in other words, even if you see the source code and algorithms described, can not be transform a MD5 value back to the original string , mathematically principle, because the original string has infinitely many, it's a bit like a mathematical function inverse function does not exist. Therefore, to have a problem md5 password, the better approach is: You can use this system md5 () function to re-set a password such as admin, the Hash value generated by a string of passwords overwrite the original Hash value on the line a.

  It is for this reason, is now up to a code-breaking methods that hackers use what is called "running dictionary" approach. There are two ways to get the dictionary, one is used to collect the daily password string table, and the other is a method of generating permutations and combinations of these values ​​to calculate the MD5 MD5 dictionary entries with program and then use the target MD5 value retrieved in the dictionary. We assume that the maximum password length is eight bytes (8 Bytes), while only the password of letters and numbers, a total of 26 + 26 + 10 = 62 characters, a number of permutations and combinations of the dictionary is P (62, 1) + P (62,2) .... + P (62,8), that's already a very astronomical figures, and you need to store the dictionary TB-level disk arrays, but this method has a precondition, that can only be the case password MD5 value to obtain the target account. This encryption technology is widely used in UNIX systems, which is why a UNIX system is more robust than most important reason for the operating system.

Reproduced in: https: //www.cnblogs.com/henryhappier/archive/2011/03/15/1984730.html

Guess you like

Origin blog.csdn.net/weixin_34308389/article/details/93537272