diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2011-06-22 00:38:02 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2011-06-22 00:38:02 -0400 |
| commit | 67ac29115c84b447d0fddef406ba591691d069ef (patch) | |
| tree | 3b5117226639501c1254e79331480183fc87aaf0 /crypto/test-pem.js | |
| parent | 571b3ce7234551b02bb8deca36b81177a5e256d3 (diff) | |
| download | alias-67ac29115c84b447d0fddef406ba591691d069ef.tar.gz | |
Added script to generate object
Proof of concept almost ready!
Diffstat (limited to 'crypto/test-pem.js')
| -rw-r--r-- | crypto/test-pem.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crypto/test-pem.js b/crypto/test-pem.js new file mode 100644 index 0000000..91c0dc4 --- /dev/null +++ b/crypto/test-pem.js @@ -0,0 +1,23 @@ +load('jsbn.js') +load('jsbn2.js') +load('rsa.js') +load('rsa2.js') +//load random number generator +//TODO: plug-in sjcl random generator +load('prng4.js') +load('rng.js') +//next 2 scripts add a method to read an rsa key in the pem format +load('asn1hex.js') +load('rsa-pem.js') +load('base64.js') + +key_string = read('key.pem') +key = new RSAKey() +key.readPrivateKeyFromPEMString(key_string) +cypher = key.encrypt("Guillaume est plus fort que Thibaut") +test = key.decrypt(cypher) + +key2 = new RSAKey() +key2.generate(2048,"10001") + + |
