Commit a6f77a1f authored by Daniel Hofmann's avatar Daniel Hofmann
Browse files

JS interop

parent ff7c0544
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>AES (in CBC mode) language interop tester</title>
<!-- notes:
- host locally!
--!>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
</head>
<body>
<p>check console for now!</p>
</body>
<script>
"use strict";
var plaintext = 'Hello';
var key = '0000000000000000';
var iv = '0000000000000000';
var opts = { iv: iv,
keySize: 128 / 8,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7 };
var enc = CryptoJS.AES.encrypt(plaintext, key, opts);
console.log({key: key, iv: iv, plaintext: plaintext});
console.log(enc.toString())
</script>
</html>
<!-- vim: set tabstop=4 shiftwidth=4 expandtab: --!>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment