Class KettleTwoWayPasswordEncoder

  • All Implemented Interfaces:
    org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface

    public class KettleTwoWayPasswordEncoder
    extends Object
    implements org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
    This class handles basic encryption of passwords in Kettle. Note that it's not really encryption, it's more obfuscation. Passwords are difficult to read, not impossible.
    Since:
    17-12-2003
    Author:
    Matt
    • 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
    • Constructor Detail

      • KettleTwoWayPasswordEncoder

        public KettleTwoWayPasswordEncoder()
    • Method Detail

      • init

        public void init()
                  throws org.pentaho.support.encryption.PasswordEncoderException
        Specified by:
        init in interface org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
        Throws:
        org.pentaho.support.encryption.PasswordEncoderException
      • encode

        public String encode​(String rawPassword)
        Specified by:
        encode in interface org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
      • encode

        public String encode​(String rawPassword,
                             boolean includePrefix)
        Specified by:
        encode in interface org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
      • decode

        public String decode​(String encodedPassword)
        Specified by:
        decode in interface org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
      • decode

        public String decode​(String encodedPassword,
                             boolean optionallyEncrypted)
        Specified by:
        decode in interface org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
      • encryptPasswordInternal

        protected String encryptPasswordInternal​(String password)
      • decryptPasswordInternal

        protected String decryptPasswordInternal​(String encrypted)
      • getSeed

        protected String getSeed()
      • getPrefixes

        public String[] getPrefixes()
        Specified by:
        getPrefixes in interface org.pentaho.di.core.encryption.TwoWayPasswordEncoderInterface
      • encryptPasswordIfNotUsingVariablesInternal

        protected final String encryptPasswordIfNotUsingVariablesInternal​(String password)
        Encrypt the password, but only if the password doesn't contain any variables.
        Parameters:
        password - The password to encrypt
        Returns:
        The encrypted password or the
      • decryptPasswordOptionallyEncryptedInternal

        protected final String decryptPasswordOptionallyEncryptedInternal​(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 "
      • encryptPasswordIfNotUsingVariables

        public static final String encryptPasswordIfNotUsingVariables​(String password)
        Deprecated.
        - Use the instance method through Encr instead of this directly
        Encrypt the password, but only if the password doesn't contain any variables.
        Parameters:
        password - The password to encrypt
        Returns:
        The encrypted password or the
      • decryptPasswordOptionallyEncrypted

        public static final String decryptPasswordOptionallyEncrypted​(String password)
        Deprecated.
        - Use the instance method through Encr instead of this directly
        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 "
      • encryptPassword

        public static final String encryptPassword​(String password)
        Deprecated.
        - use the instance method through Encr instead of this directly
        Deprecared - use the instance method instead
        Parameters:
        password -
        Returns:
        encrypted password
      • decryptPassword

        public static final String decryptPassword​(String encrypted)
        Deprecated.
        Deprecated - use Encr instead of this directly
        Parameters:
        encrypted -
        Returns:
        decrypted password