On Sat, Sep 1, 2012 at 6:06 AM, Mike Hamburg <
mi...@shiftleft.org> wrote:
> It's trickier than I'd like. You'll need a JSON parser, a base64 decoder, and a crypto suite capable of PBKDF2 (with SHA256), AES and CCM mode, and you'll have to more or less re-implement SJCL's dataflow. Parse the JSON; send the salt and password through PBKDF2 with the right number of iterations; pass the key and IV into CCM; decrypt the ciphertext.
Besides that you need to take care that you follow SJCL conventions. I
know since I created an (unfinished) SJCL compatible Java library. For
instance, binary data is not directly supported by JSON, and SJCL does
not use the '=' padding character for base64 encoding.
CCM mode encryption is also something that is not so commonly
available, and it is a bit of a pain to work with, certainly much
worse in that regard than GCM.
That said, as the main functionality of my Java code is there, it is
certainly possible.
Regards,
Maarten