Fix CBC encryption, test
This commit is contained in:
parent
e35148add8
commit
e07759a93c
2 changed files with 14 additions and 2 deletions
|
@ -62,10 +62,10 @@ window.textsecure.subtle = (function() {
|
|||
assertIsArrayBuffer(plaintext);
|
||||
assertIsArrayBuffer(key);
|
||||
assertIsArrayBuffer(iv);
|
||||
return CryptoJS.AES.encrypt(btoa(getString(plaintext)),
|
||||
return CryptoJS.AES.encrypt(CryptoJS.enc.Latin1.parse(getString(plaintext)),
|
||||
CryptoJS.enc.Latin1.parse(getString(key)),
|
||||
{iv: CryptoJS.enc.Latin1.parse(getString(iv))})
|
||||
.toString(CryptoJS.enc.Latin1);
|
||||
.ciphertext.toString(CryptoJS.enc.Latin1);
|
||||
};
|
||||
function decryptAESCBC(ciphertext, key, iv) {
|
||||
assertIsArrayBuffer(ciphertext);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue