<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script>
<script>
$(document).ready(function(){
// encode
var hash = CryptoJS.MD5("hello");
var key = CryptoJS.enc.Utf8.parse(hash); // hex로 변환
var base64 = CryptoJS.enc.Base64.stringify(key); // hex를 원래 포멧으로 변환
console.log("hash:"+hash);
console.log("base64:"+base64);
// decrypt
var decrypt = CryptoJS.enc.Base64.parse(base64);
var hashData = decrypt.toString(CryptoJS.enc.Utf8);
console.log("decrypt hash:", hashData);
});
</script>
</head>
</html>