Class PasswordObscurification
java.lang.Object
org.pentaho.reporting.libraries.base.util.PasswordObscurification
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
FieldsModifier and TypeFieldDescriptionstatic final StringThe word that is put before a password to indicate an encrypted form. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
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:
-
-
Method Details
-
byteToHexString
-
charToHex
- Throws:
UnsupportedEncodingException
-
encryptPassword
-
decryptPassword
-
encryptPasswordWithOptionalEncoding
-
decryptPasswordWithOptionalEncoding
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 "
-