From 67ac29115c84b447d0fddef406ba591691d069ef Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Wed, 22 Jun 2011 00:38:02 -0400 Subject: Added script to generate object Proof of concept almost ready! --- crypto/encrypt_object.js | 43 +++++++++++++++++++++++++++++++++++++++++++ crypto/test-pem.js | 23 +++++++++++++++++++++++ crypto/test.js | 23 ----------------------- 3 files changed, 66 insertions(+), 23 deletions(-) create mode 100644 crypto/encrypt_object.js create mode 100644 crypto/test-pem.js delete mode 100644 crypto/test.js (limited to 'crypto') diff --git a/crypto/encrypt_object.js b/crypto/encrypt_object.js new file mode 100644 index 0000000..b2efa8b --- /dev/null +++ b/crypto/encrypt_object.js @@ -0,0 +1,43 @@ +load('jsbn.js') +load('jsbn2.js') +load('rsa.js') +load('rsa2.js') +load('sjcl.js') +load('prng4.js') +load('rng.js') + +var root = '/var/lib/alias' +var priv_key_string = read(root + '/guillaume@alias.im/privkey/object') +var pub_key_string1 = read(root + '/guillaume@alias.im/pubkey/object') +var pub_key_string2 = read(root + '/thrasibule@alias.im/pubkey/object') +var pub_key1 = new RSAKey() +var pub_key1_json = JSON.parse(pub_key_string1) +pub_key1.setPublic(pub_key1_json.n,pub_key1_json.e) +var pub_key2 = new RSAKey() +var pub_key2_json = JSON.parse(pub_key_string2) +pub_key2.setPublic(pub_key2_json.n,pub_key2_json.e) + + +varpriv_key = sjcl.decrypt("Mvdujq06",priv_key_string) + +var profile = '

John Doe

\ +