javascript-blowfish icon indicating copy to clipboard operation
javascript-blowfish copied to clipboard

Unexpected results with CBC

Open hugo-dlb opened this issue 5 years ago • 1 comments

Hello,

I have unexpected results that are not the same as http://www.txtwizard.net/crypto and other websites.

My code:

const bf = new Blowfish('secret', 'cbc');
const encrypted = bf.encrypt('message', '00000000');  
const base64Encrypted = bf.base64Encode(encrypted);
console.log(base64Encrypted);

Output: fzAONXVl9nA=

Output with the same parameters from txtwizard: /ClZ1D/um40=

hugo-dlb avatar Dec 31 '19 15:12 hugo-dlb

I think it is because the padding is not PKCS5 by default. With other libraries which use PKCS5, it's working.

hugo-dlb avatar Dec 31 '19 15:12 hugo-dlb