Giter Club home page Giter Club logo

blowfish.js's People

Contributors

drench avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

blowfish.js's Issues

Padding

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.

Decrypt string and original string are not equal

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 !

Sometimes fails to encrypt json

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.