Class DefaultCryptor

  • All Implemented Interfaces:
    Cryptor

    public class DefaultCryptor
    extends java.lang.Object
    implements Cryptor
    Allows passwords to be encrypted and decrypted.

    Warning: This uses AES128 with a fixed encryption key. This is only an obfuscation no cryptographic secure protection.

    Since:
    2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultCryptor()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String decrypt​(java.lang.String encryptedKey)
      Decrypts the password.
      java.lang.String encrypt​(java.lang.String plainKey)
      Encrypt the plain text password.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • encrypt

        public java.lang.String encrypt​(java.lang.String plainKey)
                                 throws java.lang.Exception
        Encrypt the plain text password.

        Warning: This uses AES128 with a fixed encryption key. This is only an obfuscation no cryptographic secure protection.

        Specified by:
        encrypt in interface Cryptor
        Parameters:
        plainKey - The password.
        Returns:
        The encrypted password String.
        Throws:
        java.lang.Exception - If an error occurs.
      • decrypt

        public java.lang.String decrypt​(java.lang.String encryptedKey)
                                 throws java.lang.Exception
        Decrypts the password.
        Specified by:
        decrypt in interface Cryptor
        Parameters:
        encryptedKey - the encrypted password.
        Returns:
        The plain text password.
        Throws:
        java.lang.Exception - If an error occurs.