Cryptography.SHA1Managed : Cryptography « Development « ASP.NET Tutorial






<%@ Page %>
<script Language="vb" runat="server">
Private Sub Page_Load(sender As Object, e As System.EventArgs)
   Dim clearText As String = "Try not.  Do.  Or do not.  There is no try."
   Dim encoder As New System.Text.UTF8Encoding()
   
   Response.Write(("Clear Text: " + clearText))
   Response.Write("<hr>")
   
   Dim sha As New System.Security.Cryptography.SHA1Managed()
   Dim input As Byte() = encoder.GetBytes(clearText)
   Dim output As Byte() = sha.ComputeHash(input)
   Response.Write(("Encrypted Text: " + encoder.GetString(output)))
End Sub
</script>








9.9.Cryptography
9.9.1.Generate Keys
9.9.2.Cryptography.SHA1Managed
9.9.3.Decrypt / Encrypt