Message to encrypt: 6b0005000000cfe000004001
Key to encrypt with: 5eae7abca1d17b3c390e6e9b7f2e9f99
The specification tells me to use AES/CBC/NoPadding and the IV should be all zeroes.
When using http://aes.online-domain-tools.com/ I get this correct encrypted string: 5eae7abca1d17b3c390e6e9b7f2e9f99
.
I cannot reproduce the same encrypted string using CryptoJS. Here is my attempt:
const encryptedBlock = CryptoJS.AES.encrypt(
CryptoJS.enc.Hex.parse('6b0005000000cfe000004001'),
CryptoJS.enc.Hex.parse('5eae7abca1d17b3c390e6e9b7f2e9f99'),
{
iv: CryptoJS.enc.Hex.parse('00000000000000000000000000000000'),
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.NoPadding,
}
);
When I run encryptedBlock.toString()
I get xbQlyHrk23PX+QzH
.
How can I correct my use of CryptoJS's encrypt function so that I receive the correct response?