Think about it: when we go to the bank to save money, if the password of our bank card is clearly displayed in the computer, what are the disadvantages?
Without explanation, you can think of the security of passwords stored in plain text. Once a hacker attacks the database system of a bank, the passwords of all the card numbers in it will be exposed; even bank staff do not want them to see their passwords. Therefore, we need to encrypt the password.
There are many encryption methods. Here is a simple introduction: MD5AlgorithmEncryption
The MD5 algorithm is a hash algorithm, not a pure compression algorithm, not an encryption algorithm.
MD5 encryption converts a string of any length into a unique 32-bit character. We can see that the string of any length is unique and has a fixed length (32 characters ).
From the above analysis, we can see a disadvantage of the MD5 Algorithm: the source data is infinite (because it is of any length), and the number of MD5 is limited (because the length is fixed ). There is a situation where the two source data correspond to an MD5 value (Multiple-to-one relationship ).
This is exactly why the MD5 algorithm is irreversible.
When a password is lost, is the password reset or retrieval?
Because the password converted using the MD5 algorithm is irreversible, when the user loses the password, there is no way to help the user retrieve the previous password. You can only submit an application, the system re-sets a new password for the user.
You may have heard of Wang Xiaoyun's message about cracking the MD5 algorithm. In principle, the MD5 algorithm is irreversible. The only attack method is collision (because multiple source data correspond to one MD5 value ), however, the probability of such a collision is very, very small, and what Wang Xiaoyun does is only find the theory that shortens the enumeration collision time.
You can calculate the MD5 value twice or add a fixed string to increase the difficulty of brute-force MD5 Algorithm cracking.