brix / crypto-js

JavaScript library of crypto standards.
Other
15.88k stars 2.39k forks source link

ECB - Zeropadding giving the wrong output. #445

Open AzranAzwer opened 1 year ago

AzranAzwer commented 1 year ago
 import * as CryptoJS from 'crypto-js'
 import ZeroPadding from 'crypto-js/pad-zeropadding'
 import ECB from 'crypto-js/mode-ecb'

 const encrypted = CryptoJS.AES.encrypt("dataString", "KEYString" {
                                        mode: ECB,
                                        padding: ZeroPadding
                                     }).toString()
const fin = stringToBytes(encrypted)
console.log('encrypted', fin)

Followed above pattern, giving the wrong output.