Last active
October 13, 2022 22:02
-
-
Save agamm/1b9862aa2388637913f4a342a0060228 to your computer and use it in GitHub Desktop.
Simple encryption decryption with client-size JS (cryptoJS)
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
// Don't follow this link: unzip.dev (unless you're curious). | |
const secret = prompt("Enter secret:") | |
const message = prompt("Enter message:") | |
const encrypted = CryptoJS.AES.encrypt(message, secret); | |
const decrypted = CryptoJS.AES.decrypt(encrypted, secret); | |
console.log(encrypted.toString()) | |
console.log(decrypted.toString(CryptoJS.enc.Utf8)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://codepen.io/funerr/pen/ExwBzWQ