AES Encryption
How can you use AES encryption in classic ASP without a component?
Use the AES library written by Phil Fresle with the plain text input and output wrapper functions from the WROX p2p forum with the bug fixes by me. (Available Below).
Provide some data in and a password to test. The password can be many words.
<%
Option Explicit
Session.CodePage=65001
Response.Charset="UTF-8"
%>
<!--#include virtual="include/aesLibrary.asp"-->
<%
Dim dataIn, encrypted, decrypted, password
if LCase(Request.ServerVariables("HTTP_METHOD"))="post" then
dataIn=request.form("dataIn")
password=request.form("password")
encrypted = AESEncrypt(dataIn, password)
decrypted = AESDecrypt(encrypted, password)
end if
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>rodsdot.com :: AES encryption and decryption</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005-2010 Roderick Divilbiss">
</head>
<body>
<form method="POST" action="AES.asp">
<p>Data In<br><textarea rows="5" name="dataIn" cols="50"><%=dataIn%></textarea></p>
<p>Password<br><input type="text" name="password" size="50" value="<%=password%>"></p>
<p><input type="submit" value="Submit" name="B1"></p>
<p>Encrypted<br><textarea rows="5" name="encrypted" cols="50"><%=encrypted%></textarea></p>
<p>Decrypted<br><textarea rows="5" name="decrypted" cols="50"><%=decrypted%></textarea></p>
</form>
</body>
</html>