I'm trying to use sjcl to encrypt and then decrypt an arraybuffer. I can see in the source that sjcl has a codec for arraybuffer but I just can't figure out how to use it:
const buffer = new ArrayBuffer(64);
const view = new Uint8Array(buffer);
console.log(view.length)
var encrypted = sjcl.encrypt("password", buffer)
console.log(encrypted.length)
var decrypted = sjcl.decrypt("password", encrypted)
console.log(decrypted.length)
The first console.log() prints 64 (which makes sense). The second console.log() prints 150 (the size of the encrypted results)... But the third console.log always prints 0.