Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trycf/7e8ed808ac0bd19053ef92beaaba86d3 to your computer and use it in GitHub Desktop.
Save trycf/7e8ed808ac0bd19053ef92beaaba86d3 to your computer and use it in GitHub Desktop.
TryCF Gist
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js" integrity="sha256-/H4YS+7aYb9kJ5OKhFYPUjSJdrtV6AeyJOtTkw6X72o=" crossorigin="anonymous"></script>
<cfscript>
// Plain text to encrypt
encryptedText = encrypt("top secret", "WTq8zYcZfaWVvMncigHqwQ==", "AES", "Base64")
// Expected result: "39EE0FE0EF686D6619BA8D55D4FC57C2AB35DDE7E692AD051F900906B0E53317"
writeOutput(encryptedText);
</cfscript>
<script>
var textToEncrypt = 'top secret';
var secretPhrase = 'WTq8zYcZfaWVvMncigHqwQ==';
var x = CryptoJS.AES.decrypt(textToEncrypt, secretPhrase);
console.log(x.toString());
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment