gitblit-org / gitblit

pure java git solution
http://gitblit.com
Apache License 2.0
2.28k stars 670 forks source link

command line password encode #1336

Open darmbrust opened 4 years ago

darmbrust commented 4 years ago

Adding something like this would be handy for preparing accounts for use cases like mine that involve docker, and pre-created accounts for system access.

PasswordHashPbkdf2

    public static void main(String[] args)
    {
        System.out.println("Please enter the password to hash:");
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String temp = br.readLine();
        System.out.println(new PasswordHashPbkdf2().toHashedEntry(temp.toCharArray(), ""));
    }

Related to this enhancement: https://github.com/gitblit/gitblit/issues/1166