select case request.form("action") case "generate keys" call objrsa.genkey() lngkeye = objrsa.publickey lngkeyd = objrsa.privatekey lngkeyn = objrsa.modulus case "encrypt" objrsa.publickey = lngkeye objrsa.modulus = lngkeyn strmessage = objrsa.encode(strmessage) case "decrypt" objrsa.privatekey = lngkeyd objrsa.modulus = lngkeyn strmessage = objrsa.decode(strmessage) end select
set objrsa = nothing
end if %> <html> <head> <title>rsa cipher demonstration</title> </head> <body> <h1>rsa cipher demonstration</h1> <p> you will first need to generate your public/privage key-pair before you can encrypt/decrypt messages. </p> <form method="post"> <table> <tr> <td>public key</td> <td><input name="keye" value="<%=server.htmlencode(lngkeye)%>"></td> <td rowspan="3"> <input type="submit" name="action" value="generate keys"> </td> </tr> <tr> <td>private key</td> &nbs