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

Decrypt string and original string are not equal #3

Open
Partenopeo83 opened this issue Jan 27, 2015 · 1 comment
Open

Decrypt string and original string are not equal #3

Partenopeo83 opened this issue Jan 27, 2015 · 1 comment

Comments

@Partenopeo83
Copy link

Hi, i trying to test the script for a project. But i noted that after decryptation the string is not equal to the original.Why?

This is my code:

var bf = new Blowfish('text code');
var test = "test";
var ciphertext = bf.encrypt(test);
var plaintext = bf.decrypt(ciphertext);

    console.log(plaintext);
    alert(test === plaintext);

Thanks for help !

@egoroof
Copy link

egoroof commented Mar 7, 2017

Because of padding. Take a look at https://github.com/egoroof/blowfish

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

2 participants