Skip to content

Instantly share code, notes, and snippets.

@fukayatsu
Last active December 20, 2015 23:18
Show Gist options
  • Save fukayatsu/6210988 to your computer and use it in GitHub Desktop.
Save fukayatsu/6210988 to your computer and use it in GitHub Desktop.
<html>
<head>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
</head>
<body>
<script>
var word = "なんやかんや";
var encrypted = CryptoJS.AES.encrypt(word, "pass phrase").toString();
var decrypted = CryptoJS.AES.decrypt(encrypted, "pass phrase").toString(CryptoJS.enc.Utf8);
console.log(word == decrypted);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment