public class UnixCrypt
extends java.lang.Object
Based on C source code written by Eric Young (eay@psych.uq.oz.au).
The crypt(3) algorithm is not recommended for new applications that require password hashing and do not need to be compatible with Unix, because it has the following weaknesses:
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.5 $
Constructor and Description |
---|
UnixCrypt(java.lang.String salt)
Constructs a UnixCrypt instance with the given salt value.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
crypt(java.lang.String original)
Processes original and the salt value passed in the constructor
using the crypt(3) algorithm, and returns the resulting hash as a
String.
|
static void |
main(java.lang.String[] args)
Calculates the hash of a salt and password given on the command line.
|
public UnixCrypt(java.lang.String salt)
If salt
is null then "AA" is taken as the
salt value.
salt
- the salt value as a Stringpublic java.lang.String crypt(java.lang.String original)
original
- the plaintext passwordpublic static void main(java.lang.String[] args)
Usage:
java cryptix.tools.UnixCrypt [<salt>] <clear-password>