fr.xephi.authme.security.crypts
Class WHIRLPOOL

java.lang.Object
  extended by fr.xephi.authme.security.crypts.WHIRLPOOL
All Implemented Interfaces:
EncryptionMethod

public class WHIRLPOOL
extends java.lang.Object
implements EncryptionMethod


Field Summary
static int DIGESTBITS
          The message digest size (in bits)
static int DIGESTBYTES
          The message digest size (in bytes)
 
Constructor Summary
WHIRLPOOL()
           
 
Method Summary
 boolean comparePassword(java.lang.String hash, java.lang.String password, java.lang.String playerName)
           
 java.lang.String getHash(java.lang.String password, java.lang.String salt, java.lang.String name)
           
 void NESSIEadd(byte[] source, long sourceBits)
          Delivers input data to the hashing algorithm.
 void NESSIEadd(java.lang.String source)
          Delivers string input data to the hashing algorithm.
 void NESSIEfinalize(byte[] digest)
          Get the hash value from the hashing state.
 void NESSIEinit()
          Initialize the hashing state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIGESTBITS

public static final int DIGESTBITS
The message digest size (in bits)

See Also:
Constant Field Values

DIGESTBYTES

public static final int DIGESTBYTES
The message digest size (in bytes)

See Also:
Constant Field Values
Constructor Detail

WHIRLPOOL

public WHIRLPOOL()
Method Detail

NESSIEinit

public void NESSIEinit()
Initialize the hashing state.


NESSIEadd

public void NESSIEadd(byte[] source,
                      long sourceBits)
Delivers input data to the hashing algorithm.

Parameters:
source - plaintext data to hash.
sourceBits - how many bits of plaintext to process. This method maintains the invariant: bufferBits < 512

NESSIEfinalize

public void NESSIEfinalize(byte[] digest)
Get the hash value from the hashing state. This method uses the invariant: bufferBits < 512


NESSIEadd

public void NESSIEadd(java.lang.String source)
Delivers string input data to the hashing algorithm.

Parameters:
source - plaintext data to hash (ASCII text string). This method maintains the invariant: bufferBits < 512

getHash

public java.lang.String getHash(java.lang.String password,
                                java.lang.String salt,
                                java.lang.String name)
                         throws java.security.NoSuchAlgorithmException
Specified by:
getHash in interface EncryptionMethod
salt - (can be an other data like playerName;salt , playerName, etc... for customs methods)
Returns:
Hashing password
Throws:
java.security.NoSuchAlgorithmException

comparePassword

public boolean comparePassword(java.lang.String hash,
                               java.lang.String password,
                               java.lang.String playerName)
                        throws java.security.NoSuchAlgorithmException
Specified by:
comparePassword in interface EncryptionMethod
Returns:
true if password match, false else
Throws:
java.security.NoSuchAlgorithmException