Sample code for 30+ languages & platforms
AutoIt

Example: Crypt2.DecryptStringENC method

Demonstrates how to call the DecryptStringENC method.

Chilkat AutoIt Downloads

AutoIt
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oCrypt = ObjCreate("Chilkat.Crypt2")

$oCrypt.CryptAlgorithm = "aes"
$oCrypt.CipherMode = "cbc"
$oCrypt.KeyLength = 128
$oCrypt.SetEncodedKey "000102030405060708090A0B0C0D0E0F","hex"
$oCrypt.SetEncodedIV "000102030405060708090A0B0C0D0E0F","hex"
$oCrypt.EncodingMode = "base64"

; Return the base64 encoded encrypted bytes
Local $sEncodedEncrypted = $oCrypt.EncryptStringENC("Hello World!")
ConsoleWrite("Encrypted: " & $sEncodedEncrypted & @CRLF)

; Output:
; Encrypted: qiq+IFhcjTkEIkZyf31V/g==

; Decrypt
Local $sOriginalText = $oCrypt.DecryptStringENC($sEncodedEncrypted)

ConsoleWrite("Decrypted: " & $sOriginalText & @CRLF)

; Output:
; Decrypted: Hello World!