Skip to content

Instantly share code, notes, and snippets.

@camrobert
Last active February 21, 2024 12:41
Show Gist options
  • Save camrobert/3e2ac76ac3db9b1c0f384b08530d6ccc to your computer and use it in GitHub Desktop.
Save camrobert/3e2ac76ac3db9b1c0f384b08530d6ccc to your computer and use it in GitHub Desktop.
AMPscript to Encrypt and Decrypt Symmetric using DES to use with external services
%%[
SET @text = "Cameron Robert"
SET @key = "8ce32e59" /* https://www.browserling.com/tools/random-hex */
OutputLine(Concat("Encrypted: ", EncryptSymmetric(@text, "des;mode=ecb;padding=pkcs7", @null, @key),"<br><br>"))
SET @enctext = "iJwqnvvKdIIn7AKQOg1LHA=="
OutputLine(Concat("Decrypted: ", DecryptSymmetric(@enctext, "des;mode=ecb;padding=pkcs7", @null, @key),"<br><br>"))
]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment