Products » dgEncrypt User Guide

Method:  Cipher::DecryptStringBase64

DecryptStringBase64(CipherText)

The DecryptStringBase64 method decrypts a string of base64-encoded cipher text produced by a call to EncryptStringBase64, and returns the resulting plain text as a string value.
 
CipherText
The CipherText argument is the string to be decrypted.
 
Example:
<%
Dim strCipherText

strCipherText = Request.Form("Password")

If strCipherText = "" Then
    Response.Redirect "error.asp"
End If

Dim strPassword
Dim objKey
Dim objCipher

' HKeyLocalMachine = &H80000002
Set objKey = Server.CreateObject("dgEncrypt.Key")
objKey.ReadKeyRegistry &H80000002, "SOFTWARE\Website", "LoginKey"

Set objCipher = Server.CreateObject("dgEncrypt.Cipher")
objCipher.SetKey objKey
strPassword = objCipher.DecryptStringBase64(strCipherText)


' . . .


Set objCipher = Nothing
Set objKey = Nothing
%>