cryptocat/cryptocat — pull request #413 by Dirbaio (2013-08-15 02:33:32+00:00)
Title: Fix #410 (except the quote bug)

Sorry for the big commit, it changes many things at once, but they're small things.

- Added a new function Cryptocat.rawBytes that returns random bytes in a WordArray
- Added two new functions. BigInt.bigInt2base64 and BigInt.base642bigInt, that convert BigInts to/from standard Base64 (little-endian representation).
- All key variables in multiParty are now stored in WordArrays (or BigInts for public/private keys), not on strings encoded with various ways.
- All crypto operations are now done with BigInts or WordArrays. Base64 is only used when sending/receiving.
- The random padding is now 64 raw bytes instead of 64 chars.
- HMAC and Tag are computed on concatenation of binary data.
- Added a new field in the message JSON: "type". It can be either "message", "publicKey" or "publicKeyRequest".
- In case of "message", "message" contains the ciphertext, "iv" the IV, "hmac" the HMAC, all Base64 (same as before)
- In case of "publicKey", "message" contains the public key in Base64 (without the magic string prepended)
- In case of "publicKeyRequest", there are no other fields.

(This last one was not on #410 but it's still something I think it's good to change. Magic strings are bad)