System.Security.Cryptography.CryptoStream pCryptoStream =
new System.Security.Cryptography.CryptoStream(pMemoryStream,pICryptoTransform,System.Security.Cryptography.CryptoStreamMode.Write);
System.Security.Cryptography.CryptoStream pCryptoStream =
new System.Security.Cryptography.CryptoStream(pMemoryStream,pICryptoTransform,System.Security.Cryptography.CryptoStreamMode.Write);
<script type="text/javascript" >
function String.prototype.xor(key) //异或操作,也就是通用的对称加密、解密操作
{
var result = "";
for (var i=0; i<this.length; i++)
result += String.fromCharCode(this.charCodeAt(i)^key.charCodeAt(i%key.length));
return result;
}
var str = "test";
alert(str.xor("2"))
</script>
Dim md5Hasher As New MD5CryptoServiceProvider
Dim hashedDataBytes As Byte()
Dim encoder As New UTF8Encoding
hashedDataBytes = md5Hasher.ComputeHash(encoder.GetBytes(TextBox2.Text))