A weird issue has come up recently where the padding seems to be messed up.
To replicate:
var me = new Blowfish("me");
var Data = me.encrypt("stuff");
alert(me.decrypt(Data));
It should alert "stuff" but instead its "stuff000"
I wrote this simple addon for the decrypt function to fix it:
//Patch by me to remove trailing zeros
returndata = this.unescape(dec);
revertext = returndata.split("").reverse();
for(i=0;i<8;i++){
if(revertext[i] == "0"){
delete revertext[i];
}
}
returndata = revertext.reverse().join("");*
return returndata;
but it is obviously not ideal.
A weird issue has come up recently where the padding seems to be messed up.
To replicate:
var me = new Blowfish("me");
var Data = me.encrypt("stuff");
alert(me.decrypt(Data));
It should alert "stuff" but instead its "stuff000"
I wrote this simple addon for the decrypt function to fix it:
but it is obviously not ideal.