Open ZHAO-Clara opened 6 months ago
If the length of iv is less than 16, how does 'crypto-js' pad it (make the iv length expanded to the length of 16)?
for example i use the following code, what is the ’iv‘ actually used during the encryption process? like '432100000000'?
const CryptoJS = require('crypto-js') const key = CryptoJS.enc.Utf8.parse('12345678ABCD') const iv = CryptoJS.enc.Utf8.parse('4321') let srcs = CryptoJS.enc.Utf8.parse(word) let encrypted = CryptoJS.AES.encrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 })
Thank you so much
I have the answer. Actually it uses the "null" in ascii to pad iv, in other words, 0x00 in Hex.
If the length of iv is less than 16, how does 'crypto-js' pad it (make the iv length expanded to the length of 16)?
for example i use the following code, what is the ’iv‘ actually used during the encryption process? like '432100000000'?
Thank you so much