Home|Sitemap|Contact

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.

Data In

Password

Encrypted

Decrypted



<%
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, 2006 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>  


aesLibrary.asp


Most Popular Pages On rodsdot.com

Client Side Includes Using JavaScript
Creating A JavaScript Slider Input in JavaScript
Creating Conditional Links With ASP
Dynamically Adding Rows and Fields To A Table Based Form
Geo-Coding IP Addresses
How To Make A Pop Over Menu
JavaScript Date Validation DD/MM/YYYY
JavaScript Date Validation MM/DD/YYYY
Parameterized SQL Using Multiple Form Inputs and Filtering
Play A WAV File On Mouseover
Pop Over Form
Resorting A Multi-Dimensional Table Using Client-Side JavaScript
Scripting Remote Images in JavaScript
Using AJAX to Return HTML For Dynamic Forms
Using Images For CAPTCHA
Using Parameterized SQL with ASP and MS Access
Why JavaScript As The HREF Of A Link Is Bad