blowfish.js icon indicating copy to clipboard operation
blowfish.js copied to clipboard

Decrypt string and original string are not equal

Open Partenopeo83 opened this issue 11 years ago • 1 comments

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 !

Partenopeo83 avatar Jan 27 '15 11:01 Partenopeo83

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

egoroof avatar Mar 07 '17 05:03 egoroof