comment about encryption IV

This commit is contained in:
Mo Bitar
2017-01-18 21:26:35 -06:00
parent 2b55a4f6b0
commit e9774ad823

View File

@@ -39,6 +39,7 @@ class SNCrypto {
encryptText(text, key) {
var keyData = CryptoJS.enc.Hex.parse(key);
// items are encrypted with random keys; no two items are encrypted with same key, thus IV is not needed
var ivData = CryptoJS.enc.Hex.parse("");
var encrypted = CryptoJS.AES.encrypt(text, keyData, { iv: ivData, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
return encrypted.toString();