From 015e2d2492519c96dda7a310d888b29984e9fead Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Sat, 18 Feb 2012 19:07:39 -0500 Subject: Implementation of aes-ocb in python and javascript We can know easily encrypt directories in python, and generate objects in the alias format. --- crypto/ocb.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 crypto/ocb.js (limited to 'crypto/ocb.js') diff --git a/crypto/ocb.js b/crypto/ocb.js new file mode 100644 index 0000000..d7d53aa --- /dev/null +++ b/crypto/ocb.js @@ -0,0 +1,8 @@ +load('sjcl.js') +var aeskey = sjcl.codec.hex.toBits('12538243c49f1c58e6f7b0687bbd65b2') +var iv = sjcl.codec.hex.toBits('250c3041c00a605a4100e264abbc588b') +plaintext = "La chaire est triste, hélas ! et j'ai lu tous les livres." +var secret = sjcl.encrypt(aeskey, plaintext,{mode:'ocb2', iv:iv, adata:"", tag:128}) +var secret2 = sjcl.json.decode(secret) +print(secret) +print(sjcl.codec.hex.fromBits(secret2.ct)) -- cgit v1.2.3-70-g09d2