<%@ page language= "C #" contenttype= "text/html"%> <%@ Import namespace= "System"%> <script language= "C #" R unat= "Server" > void Page_Load (Object Sender,eventargs e) {//Get field to encrypt and convert to byte[] array byte[] Data=system.text.encoding . Unicode.getbytes (source. Text.tochararray ()); Establish cryptographic service System.Security.Cryptography.MD5 MD5 = new System.Security.Cryptography.MD5CryptoServiceProvider (); Encrypted byte[] Array byte[] result= md5.computehash (data); Converts the encrypted array to a field string sresult=system.text.encoding.unicode.getstring (result); Show sha1_1.text= "MD5 normal Encryption:" +sresult.tostring () + "<br/>"; Encrypts the string enpswdstr=system.web.security.formsauthentication.hashpasswordforstoringinconfigfile (source) as a password. Text.tostring (), "MD5"); Show sha1_2.text= "MD5 password encryption:" +enpswdstr+ "<br/>"; } </script>