e);
                
                var salt = CryptoJS.enc.Base64.stringify(encryptedFile.salt);
                var iv = CryptoJS.enc.Base64.stringify(encryptedFile.iv);
                var cipherText = CryptoJS.enc.Base64.stringify(encryptedFile.data.ciphertext);
                var encryptedJSON = JSON.stringify({salt: salt, iv: iv, data: cipherText});
                
                // Wrap template around encrypted data
                
                var encryptedDocument = templateHTML.replace("/