|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.spy.util.Digest
Digest for getting checksums, hashing passwords, stuff like that.
| Constructor Summary | |
Digest()
Get a new Digest object. |
|
| Method Summary | |
boolean |
checkPassword(String pw,
String hash)
Check a plaintext password against a hashed password. |
String |
getHash(String word)
Get a hash for a given String. |
protected String |
getHash(String word,
byte[] salt)
Get a hash for a String with a known salt. |
String |
getSaltFreeHash(String s)
Get a hash for a String with no salt. |
byte[] |
getSaltFreeHashBytes(String s)
Get the hash for a given string (with no salt). |
static void |
main(String[] args)
Commandline testing. |
void |
prefixHash(boolean doit)
If set to true, hashes will be prefixed with the type of hash used. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Digest()
| Method Detail |
public void prefixHash(boolean doit)
doit - whether or not to prefix the hash
public boolean checkPassword(String pw,
String hash)
protected String getHash(String word,
byte[] salt)
public byte[] getSaltFreeHashBytes(String s)
s - the thing to hash
public String getSaltFreeHash(String s)
public String getHash(String word)
public static void main(String[] args)
throws Exception
Making a password:
Checking a password:
Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||