Created
February 21, 2022 19:07
-
-
Save trycf/7e8ed808ac0bd19053ef92beaaba86d3 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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