????MD5??飺
????MD5???????Message-DigestAlgorithm5????90???????MIT???????????????RSADataSecurityInc????????MD2??MD3??MD4?????????MD5?????????“????”?任?????128bit?????????????????????????????????任???????仰??????????????????????????????????MD5????任?????????????????????????????????????????????????????е???????????????????????
????MD5????
??????????????????
????????padding???????????bit???λ???512?448???????????????????512?448??????512?????bit??????????????1-512???????bit?1??????????0??
?????????????????
?????????????????64bit?????????????????64bit?????????????????Χ????????64bit????????????????????棬??ú???????512bit?????????????32bit??16??????????????RFC1321?У?32bit??????word??
???????????????????????
???????4????????????A??B??C??D?????32bit????????????
????A:01234567
????B:89abcdef
????C:fedcba98
????D:76543210
???????????????????
???????????4????????????
????F(X??Y??Z)=XYvnot(X)Z
????G(X??Y??Z)=XZvYnot(Z)
????H(X??Y??Z)=XxorYxorZ
????I(X??Y??Z)=Yxor(Xvnot(Z))
???????У?XY?????λ??XvY?????λ??not(X)?????λ?????xor?????λ???
?????????е?X??Y??Z???32bit????????????????????飺T(i)??i??1-64??T(i)????abs(sin(i))??4294967296?????????????i??????
???????????????????????????32*16*Nbit
???????崠???????
??????????ABCD???????????128bit??A???λ??D???λ??
????MD5??ASP.net??C#???е?????
//??????md5??????????
stringtest="123abc";
//??????????
System.Security.Cryptography.MD5CryptoServiceProvidermd5CSP=newSystem.Security.Cryptography.MD5CryptoServiceProvider();
//???????????Σ???????Byte[]????
byte[]testEncrypt=System.Text.Encoding.Unicode.GetBytes(test);
//????Byte[]????
byte[]resultEncrypt=md5CSP.ComputeHash(testEncrypt);
//???????????????????(???????)
stringtestResult=System.Text.Encoding.Unicode.GetString(resultEncrypt);
//????????????
stringEncryptPWD=System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(test??"MD5");