Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected results with CBC #12

Open
hugo-dlb opened this issue Dec 31, 2019 · 1 comment
Open

Unexpected results with CBC #12

hugo-dlb opened this issue Dec 31, 2019 · 1 comment

Comments

@hugo-dlb
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant