ASP.NET MD5 encryption and SHA1 encrypted strings

xiaoxiao2021-03-06  98

Introduced name space

Using system.web.security;

2. Define the string to encrypted

String BeforeEncrypt, Afterencrypt;

3. Start encryption (MD5)

Afterencrypt == Formsauthentication.hashPasswordforStoringInConfigfile (BeforeEncrypt, "MD5");

4. Use SHA1 encryption (SHA1)

Afterencrypt == Formsauthentication.hashPasswordforStoringInConfigfile (BeforeEncrypt, "SHA1");

5. The length of the encrypted string

String length after SHA1 encryption is 40, and the string length after MD5 encryption is: 32

转载请注明原文地址:https://www.9cbs.com/read-122756.html

New Post(0)