CryptJS を使って AES 復号をしようとしましたが、
Javascript
1CryptoJS.AES.decrypt(text, password); 2 3text : AES暗号化 -> Base64エンコードされた文字列 4password: AESパスワード 5
を実行したら
var ciphertext = Base64.parse(openSSLStr); <= Uncaught TypeError: Cannot read property 'parse' of undefined
となりました。他にcore.js, cipher-core.js, enc-base64.js を読み込みました。
何をすれば良いでしょうか。
javascript
1cipher-core.js 2 3 parse: function (openSSLStr) { 4 // Parse base64 5 var ciphertext = Base64.parse(openSSLStr); <= Uncaught TypeError: Cannot read property 'parse' of undefined 6 7 // Shortcut 8 var ciphertextWords = ciphertext.words; 9 10 // Test for salt 11 if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { 12 // Extract salt 13 var salt = WordArray.create(ciphertextWords.slice(2, 4)); 14 15 // Remove salt from ciphertext 16 ciphertextWords.splice(0, 4); 17 ciphertext.sigBytes -= 16; 18 } 19 20 return CipherParams.create({ ciphertext: ciphertext, salt: salt }); 21 }
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。