Please visit the blowfish.js home page for more information.
drench / blowfish.js Goto Github PK
View Code? Open in Web Editor NEWAn obsolete JavaScript blowfish encryption library
An obsolete JavaScript blowfish encryption library
Please visit the blowfish.js home page for more information.
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 !
Ocassionally, the blowfish module will screw up a json request.
Example
var login = { username: "test1", password: "P@ssw0rd", gameid: '001' }
var cipherlogin = bf.encrypt(JSON.stringify(login));
var plaintextlogin = bf.decrypt(cipherlogin)
console.log(plaintextlogin)
Returns
{"username":"test1","password":"P@ssw0rd","gameid":"001"
missing the final } to close the json string.
I don't know if you update/check these anymore, but any help would be appreciated.
Using the marcelgreter branch
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 declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.