NodeJS: Can't Get Crypto Module To Give Me The Right AES Cipher Outcome
I'm trying to use the nodeJS crypto module to encrypt some hex strings using the ECB mode of AES 128. To do so, I'm using the following code: cryptoAES = function (sInput, sKey, bE
Solution 1:
Reading https://github.com/joyent/node/issues/1318#issuecomment-1562766, you do need crypto.createCipheriv()
:
cipher = crypto.createCipheriv(sAlgo, bKey, '');
That generates the required result.
Post a Comment for "NodeJS: Can't Get Crypto Module To Give Me The Right AES Cipher Outcome"