All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptix.tools.UnixCrypt

java.lang.Object
   |
   +----cryptix.tools.UnixCrypt

public class UnixCrypt
extends Object
A Java-based implementation of the Unix crypt(3) function call, used for hashing user passwords in many Unix dialects.

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.4 $

Author:
John F. Dumas (jdumas@zgs.com), Raif Naffah, David Hopwood

Constructor Index

 o UnixCrypt(String)
Constructs a UnixCrypt instance with the given salt value.

Method Index

 o crypt(String)
Processes original and the salt value passed in the constructor using the crypt(3) algorithm, and returns the resulting hash as a String.
 o main(String[])
Calculates the hash of a salt and password given on the command line.

Constructors

 o UnixCrypt
 public UnixCrypt(String salt)
Constructs a UnixCrypt instance with the given salt value. If needed this value is appended with enough A's.

If salt is null then "AA" is taken as the salt value.

Parameters:
salt - the salt value as a String

Methods

 o crypt
 public synchronized String crypt(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.

Parameters:
original - the plaintext password
Returns:
the hashed password
 o main
 public static void main(String args[])
Calculates the hash of a salt and password given on the command line.

Usage:

    java cryptix.tools.UnixCrypt [<salt>] <clear-password>
 


All Packages  Class Hierarchy  This Package  Previous  Next  Index