Node Director
Static Public Member Functions | Static Protected Member Functions | List of all members
com.graeff.pwencode.MD5Crypt Class Reference

Static Public Member Functions

static void main (String argv[])
 Command line test rig.
static final String randomSalt (int len)
static final String crypt (String password)
static final String crypt (String password, String salt)

Static Protected Member Functions

static final String to64 (long v, int size)

Detailed Description

This class defines a method, crypt(), which takes a password and a salt string and generates an OpenBSD/FreeBSD/Linux-compatible md5-encoded password entry.

Created: 3 November 1999

Release: $Name$

Version: $Revision$

Last Mod Date: $Date$

Java Code By: Jonathan Abbey, jonab.nosp@m.bey@.nosp@m.arlut.nosp@m..ute.nosp@m.xas.e.nosp@m.du

Original C Version:

----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
phk@l.nosp@m.ogin.nosp@m..dkne.nosp@m.t.dk wrote this file.  As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
----------------------------------------------------------------------------

Member Function Documentation

static final String com.graeff.pwencode.MD5Crypt.crypt ( String  password)
static

This method actually generates a OpenBSD/FreeBSD/Linux PAM compatible md5-encoded password hash from a plaintext password and a salt.

The resulting string will be in the form '$1$<salt>$<hashed mess>

Parameters
passwordPlaintext password
Returns
An OpenBSD/FreeBSD/Linux-compatible md5-hashed password field.

References com.graeff.pwencode.MD5Crypt.crypt(), and com.graeff.pwencode.MD5Crypt.randomSalt().

Referenced by com.graeff.pwencode.MD5CryptEncoder.authorize(), com.graeff.pwencode.MD5Crypt.crypt(), com.graeff.pwencode.MD5CryptEncoder.encode(), and com.graeff.pwencode.MD5Crypt.main().

static final String com.graeff.pwencode.MD5Crypt.crypt ( String  password,
String  salt 
)
static

This method actually generates a OpenBSD/FreeBSD/Linux PAM compatible md5-encoded password hash from a plaintext password and a salt.

The resulting string will be in the form '$1$<salt>$<hashed mess>

Parameters
passwordPlaintext password
saltA short string to use to randomize md5. May start with $1$, which will be ignored. It is explicitly permitted to pass a pre-existing MD5Crypt'ed password entry as the salt. crypt() will strip the salt chars out properly.
Returns
An OpenBSD/FreeBSD/Linux-compatible md5-hashed password field.

References com.graeff.pwencode.MD5Crypt.to64().

static void com.graeff.pwencode.MD5Crypt.main ( String  argv[])
static

Command line test rig.

References com.graeff.pwencode.MD5Crypt.crypt().

static final String com.graeff.pwencode.MD5Crypt.randomSalt ( int  len)
static
static final String com.graeff.pwencode.MD5Crypt.to64 ( long  v,
int  size 
)
staticprotected

The documentation for this class was generated from the following file: