Giter Site home page Giter Site logo

phpass's People

Contributors

wolf480pl avatar

Stargazers

 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  avatar

phpass's Issues

There is no license.

If you intend this code to be used by other you need to include a license giving others permission to use your software and explaining the terms for use. Right now the only way anyone can legally use your code is to get written permission from you. (At least, that's how copyright law works in the US).

Consider including a MIT license with your PHPass implementation; I notice you've use the MIT license on some of your other projects.

Convert existing encoded credential to Bcrypt?

Hello,

I have a number of encoded passwords that look something like the following (representative example from WordPress):

    $P$BMYJOjzPjlG031l1/fjc938A88RsFi/

Could your library be used to convert the existing encoded passwords to an encoding via Bcrypt?  

For completeness, I am using your library and the following to generate hashed passwords now:

    PHPass pw = new PHPass(8);
    String hpw = pw.HashPassword("FOOBAR");

Please advise, and thank you.

Best regards,

rehmke

UTF-8 Conversion Problem

Hi,

we are having a problem with PHPass.java.

OS : Ubuntu linux 1204
Java: Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

PHPass downloaded from: https://github.com/Wolf480pl/PHPass

Code generating problems:

import com.github.wolf480pl.phpass.PHPass;

public class test {

public static void main(String[] args) {
    try {
        while (true) {          
            System.out.println(md5crypt("goofy"));
        }
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}

public static String md5crypt(String password) throws Exception {
    PHPass phPass = new PHPass(8);
    return phPass.HashPassword(password);
}   

}

Generated output:

$P$BUxyjxmaMlEPY9EdxTFzeogu/2Tazi.
....
many executions
....
$P$BjzPjnwyjsuuxw.Hd0sBM3uyfIrXma1
java.lang.ArrayIndexOutOfBoundsException: 5
at com.github.wolf480pl.phpass.PHPass.encode64(PHPass.java:66)
at com.github.wolf480pl.phpass.PHPass.gensaltPrivate(PHPass.java:118)
at com.github.wolf480pl.phpass.PHPass.HashPassword(PHPass.java:134)
at test.md5crypt(test.java:20)
at test.main(test.java:10)

The problem:

The problem seems to be in private byte[] stringToUtf8(String string); where you pass a String generated from an array of 6 random bytes to be converted using UTF-8, and you expect an array of at least 6 characters as result.

In many situations the returned array is less than 6 characters long.

According to this reference (http://en.wikipedia.org/wiki/UTF-8) there are many invalid characters for the UTF-8 conversion, but should be converted as more than one byte. This seems not to work.

Is this a bug of PHPass or are we making a mistake?

Thanks in advance.

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.