I've searched and can't find any documentation. Is there an example script somewhere that I could use as a template? Right now, I'm just using SpiderMonkey to get a feel for how it works from the command line.
Thanks in advance for any pointers!
Justin
Once you have an El Gamal key pair, you can use the kem (key
encapsulation mechanism) method of the public key to generate a
symmetric key and a tag for it. You can use the symmetric key to
encrypt data, and the tag to recover the symmetric key for decryption.
Here's an example:
var keys = sjcl.ecc.elGamal.generateKeys(192, 0);
var kem = keys.pub.kem(0);
// use kem.key to encrypt as normal
var ct = sjcl.encrypt(kem.key, data, params);
// use kem.tag to recover the key
var symKey = keys.sec.unkem(kem.tag)
// use symKey as normal in a call to sjcl.decrypt
Hope that helps,
Emily
> smime.p7s
> 5KViewDownload
So far, I really like what I'm seeing.