Package org.refcodes.security.ext.spring
Class TextObfuscaterUtility
java.lang.Object
org.refcodes.security.ext.spring.TextObfuscaterUtility
- All Implemented Interfaces:
org.refcodes.mixin.Loggable
The
TextObfuscaterUtility
is a mere in memory text obfuscater (as a
dynamically determined SystemContext.HOST_APPLICATION
password is
used (which is depended on the current application and the host this
application is processed on and may be acquired by accessing and manipulating
alongside executing the application on the host or heuristically simulating
the application with metrics gathered from the host).-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Fields inherited from interface org.refcodes.mixin.Loggable
RUNTIME_LOGGER_CLASS, RUNTIME_LOGGER_FACTORY_CLASS, RUNTIME_LOGGER_FACTORY_METHOD
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
toDecryptedText
(String aText) Decrypt the given text in case it has the prefix identifying the text as being encrypted, else the plain text is returned and a warning is printed out that the passed text is not encrypted (just the first two or three chars or zero chars are shown depending on the length of the text). ------------------------------------------------------------------------- Attention: A unique system TID is used for decryption.static String
toEncryptedText
(String aText) Encrypts the given text and prepends a prefix identifying the text as being encrypted. ------------------------------------------------------------------------- Attention: A unique system TID is used for encryption.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.mixin.Loggable
alert, alert, critical, critical, debug, error, info, notice, panic, trace, warn, warn
-
Field Details
-
CIPHER_UID_TIMESTAMP_LENGTH
public static final int CIPHER_UID_TIMESTAMP_LENGTH- See Also:
-
CIPHER_UID_LENGTH
public static final int CIPHER_UID_LENGTH- See Also:
-
CIPHER_LENGTH
public static final int CIPHER_LENGTH- See Also:
-
MESSAGE_LENGTH
public static final int MESSAGE_LENGTH- See Also:
-
-
Method Details
-
toDecryptedText
Decrypt the given text in case it has the prefix identifying the text as being encrypted, else the plain text is returned and a warning is printed out that the passed text is not encrypted (just the first two or three chars or zero chars are shown depending on the length of the text). ------------------------------------------------------------------------- Attention: A unique system TID is used for decryption. Decryption with this method will only work on the same system used for encryption viatoEncryptedText(String)
! ------------------------------------------------------------------------- This method is most useful for encrypting passwords or authentication credentials in configuration files on live servers to provide at least a minimum of security.- Parameters:
aText
- The text being decrypted.- Returns:
- The decrypted text.
-
toEncryptedText
Encrypts the given text and prepends a prefix identifying the text as being encrypted. ------------------------------------------------------------------------- Attention: A unique system TID is used for encryption. Decryption with thetoDecryptedText(String)
method will only work on the same system used for encryption via this method! ------------------------------------------------------------------------- This method is most useful for encrypting passwords or authentication credentials in configuration files on live servers to provide at least a minimum of security.- Parameters:
aText
- The text to be encrypted.- Returns:
- The encrypted text with the encryption identifier prefixed.
-