org.mortbay.util
Class Password

java.lang.Object
  extended by org.mortbay.util.Password

public final class Password
extends java.lang.Object

Password utility class. This utility class gets a password or pass phrase either by:

+ Password is set as a system property. + The password is prompted for
 and read from standard input + A program is run to get the password.
 
 
Passwords that begin with OBF: are de obfuscated. Passwords can be obfuscated by run org.mortbay.util.Password as a main class. Obfuscated password are required if a system needs to recover the full password (eg. so that it may be passed to another system). They are not secure, but prevent casual observation.

Passwords that begin with CRYPT: are oneway encrypted with UnixCrypt. The real password cannot be retrieved, but comparisons can be made to other passwords. A Crypt can be generated by running org.mortbay.util.UnixCrypt as a main class, passing password and then the username. Checksum passwords are a secure(ish) way to store passwords that only need to be checked rather than recovered. Note that it is not strong security - specially if simple passwords are used.

Version:
$Id$
Author:
Greg Wilkins (gregw)

Field Summary
static java.lang.String OBFUSCATE_STR
          Prefix of obfuscated login+password string.
 
Method Summary
static java.lang.String deobfuscate(java.lang.String s)
          This method return the hided string behind the specified string.
static java.lang.String obfuscate(java.lang.String s)
          This method change the specific string into another one more difficult to read
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBFUSCATE_STR

public static final java.lang.String OBFUSCATE_STR
Prefix of obfuscated login+password string.

See Also:
Constant Field Values
Method Detail

obfuscate

public static java.lang.String obfuscate(java.lang.String s)
This method change the specific string into another one more difficult to read

Parameters:
s - the original string.
Returns:
the obfuscated string.

deobfuscate

public static java.lang.String deobfuscate(java.lang.String s)
This method return the hided string behind the specified string. If the string is not hidded, it returns it.

Parameters:
s - the hided string.
Returns:
the hided string behind the specified string. If the string is not hidded, it returns it.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.