The cryptographic hash function maps a binary string of arbitrary length to a small binary string of fixed length. Password hash function has such an attribute that it is impossible to find two different inputs with the same hash value in calculation. That is to say, only when the corresponding data also match, the hash values of the two groups of data will match, and a small change in data will produce an unpredictable big change in hash value, so it is difficult for you to find clues from encrypted text.
The full name of SHA is secure hash algorithm.
The hash value of MD algorithm is bits, while the hash value of SHA algorithm is bits. Both algorithms are irreversible.
Although Professor Wang Xiaoyun of Shandong University in China gave a report on the decoding of MD HAVAL MD and RIPEMD algorithms at Crypto' in Santa Barbara, California, USA, and published the decoding results of MD series algorithms, it declared that MD5, an impregnable fortress of the world cryptographic standard, collapsed and caused an uproar in the field of cryptography, but I think this encryption security level is enough for us to do ordinary software.
What we usually use most is to encrypt the user's password, store the encrypted password in the database, encrypt the password entered by the user when comparing passwords, and then compare it with the ciphertext in the database. We don't need to care about how the encryption algorithm is implemented in ASP net class.
The following are several encryption methods in ASP.NET. There are two encryption algorithms, MD and SHA mentioned above. The example I give here is that MD and SHA are roughly the same, but they use different classes.
MD related class
System security encryption MD system security encryption MD cryptoservice provider () system web security form authentication hashpasswordforstoringconfigfile (strsource "MD") Sha related class.
System Security Cryptography sha System Security Cryptography sha Cryptography provider () System web Security Formalism HashpasswordForStoring Configfile (STRSOURCE "SHA") Method is as follows (with vs).
/* *////& lt; Summary & gt//Method 1: Create an object with the new operator//.