Class PasswordObscurification
- java.lang.Object
 - 
- org.pentaho.reporting.libraries.base.util.PasswordObscurification
 
 
- 
public final class PasswordObscurification extends Object
This class handles basic password obscurification. Note that it's not really encryption, it's more obfuscation. Passwords are difficult to read, not impossible. This implementation guarantees consistent results for all valid character ranges. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringPASSWORD_ENCRYPTED_PREFIXThe word that is put before a password to indicate an encrypted form. 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbyteToHexString(int b)static intcharToHex(int c)static StringdecryptPassword(String encrypted)static StringdecryptPasswordWithOptionalEncoding(String password)Decrypts a password if it contains the prefix "Encrypted "static StringencryptPassword(String password)static StringencryptPasswordWithOptionalEncoding(String password) 
 - 
 
- 
- 
Field Detail
- 
PASSWORD_ENCRYPTED_PREFIX
public static final String PASSWORD_ENCRYPTED_PREFIX
The word that is put before a password to indicate an encrypted form. If this word is not present, the password is considered to be NOT encrypted- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
byteToHexString
public static String byteToHexString(int b)
 
- 
charToHex
public static int charToHex(int c) throws UnsupportedEncodingException- Throws:
 UnsupportedEncodingException
 
- 
encryptPasswordWithOptionalEncoding
public static String encryptPasswordWithOptionalEncoding(String password)
 
- 
decryptPasswordWithOptionalEncoding
public static String decryptPasswordWithOptionalEncoding(String password)
Decrypts a password if it contains the prefix "Encrypted "- Parameters:
 password- The encrypted password- Returns:
 - The decrypted password or the original value if the password doesn't start with "Encrypted "
 
 
 - 
 
 -