Open nadimkobeissi opened 13 years ago
This functionality is under-supported (i.e. I haven't written it, and there's a patch someone sent me but I haven't reviewed it yet), but in short, you can extract the _exponent field and serialize it. Then calling sjcl.ecc.elGamal.secretKey(curve, exponent) will restore it. Likewise, you can extract the _point field from the public key and serialize it.
Thanks very much. Is it possible for me to check out the patch you mentioned?
The patch is here: https://github.com/bitwiseshiftleft/sjcl/pull/41
I created a new similar one with deserialization support and some more stuff in it: #99 Please discuss!
Is there a convenient way to share sjcl.ecc.elGamal.generateKeys(384, 10).pub across a network? The closest thing I could come to is use JSON.decycle and then stringifying the object, but retrocycling it and reparsing it on the other end does not result in an object that supports .kem. Furthermore, the resulting object is huge, over 10,000 characters.
How am I supposed to share an ECC public key with other people across a network?