<%@ import namespace="system.web.security" %>
<html>
<head>
<script language="vb" runat=server>
this function encrypts the input string using the sha1 and md5
encryption algorithms
sub encryptstring(src as object, e as eventargs)
sha1.text = cookieauthentication.hashpasswordforstoringinconfigfile(txtpassword.text, "sha1")
md5.text = cookieauthentication.hashpasswordforstoringinconfigfile(txtpassword.text, "md5")
end sub
</script>
</head>
<body>
<form runat=server>
<p><b>original clear text password: </b><br>
<asp:textbox id="txtpassword" runat=server />
<asp:button runat="server" text="encrypt string" onclick="encryptstring" /></p>
<p><b>encrypted password in sha1: </b>
<asp:label id="sha1" runat=server /></p>
<p><b>encrypted password in md5: </b>
<asp:label id="md5" runat=server /></p>
</form>
</body>
</html>
