Abuse Melding

Je hebt een klacht over de onderstaande posting:

19-04-2012, 12:57 door Anoniem

Totally not secure laten we maar zeggen. function randomCipher(message) { // Generate a random 256 bits key, encoded in base64: var randomkey = sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0); // Then encrypt the compressed message with this key. var data = sjcl.encrypt(randomkey,compress(message)); return {'data':data,'key':randomkey}; } Base64.. Proven to be secure, NOT // Compress a message (deflate compression). Returns base64 encoded data. function compress(message) { return Base64.toBase64(RawDeflate.deflate(Base64.utob(message))); } // Decompress a message compressed with compress(). function decompress(data) { return Base64.btou(RawDeflate.inflate(Base64.fromBase64(data))) } /* Encrypt the message with a random key. Output: An array with two items: 'data' (string) : json encoded data to store on server side (containing ciphertext,iv and salt) 'key' (string: the key (encoded in base64) to be kept on client side. Example: c ...

Beschrijf je klacht (Optioneel):

captcha