org.jclouds.crypto
Class Sha512Crypt

java.lang.Object
  extended by org.jclouds.crypto.Sha512Crypt

public class Sha512Crypt
extends Object

This class defines a method, Sha512_crypt(), which takes a password and a salt string and generates a Sha512 encrypted password entry. This class implements the new generation, scalable, SHA512-based Unix 'crypt' algorithm developed by a group of engineers from Red Hat, Sun, IBM, and HP for common use in the Unix and Linux /etc/shadow files. The Linux glibc library (starting at version 2.7) includes support for validating passwords hashed using this algorithm. The algorithm itself was released into the Public Domain by Ulrich Drepper <drepper@redhat.com>. A discussion of the rationale and development of this algorithm is at http://people.redhat.com/drepper/sha-crypt.html and the specification and a sample C language implementation is at http://people.redhat.com/drepper/SHA-crypt.txt


Nested Class Summary
static class Sha512Crypt.Function
           
 
Constructor Summary
Sha512Crypt()
           
 
Method Summary
static com.google.common.base.Function<String,String> function()
           
static String makeShadowLine(String password, String shadowPrefix, Crypto crypto)
          This method actually generates an Sha512 crypted password hash from a plaintext password and a salt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sha512Crypt

public Sha512Crypt()
Method Detail

function

public static com.google.common.base.Function<String,String> function()

makeShadowLine

public static String makeShadowLine(String password,
                                    @Nullable
                                    String shadowPrefix,
                                    Crypto crypto)
This method actually generates an Sha512 crypted password hash from a plaintext password and a salt.

The resulting string will be in the form '$6$<rounds=n>$<salt>$<hashed mess>

Parameters:
password - Plaintext password
shadowPrefix - An encoded salt/rounds which will be consulted to determine the salt and round count, if not null
Returns:
The Sha512 Unix Crypt hash text for the password


Copyright © 2009-2011 jclouds. All Rights Reserved.