How to decrypt an ArrayBuffer?
I've been trying to decrypt an ArrayBuffer object using CryptoJS, but so far it always returns a blank WordArray. The files (images) are encrypted in an iOS and Android app, sent to a server, and downloaded in this web app to be decrypted and displayed. The iOS and Android apps are able to decrypt the files without problems, so there's nothing wrong with the encryption process. The files are downloaded with an XMLHttpRequest with responseType set to arraybuffer . Here's my code so far: // Decrypt a Base64 encrypted string (this works perfectly) String.prototype.aesDecrypt = function(key) { var