Class PBEncryptionUtils


  • public class PBEncryptionUtils
    extends java.lang.Object
    This class provides basic encryption/decryption capabilities to implement PBE.

    Note: Note: Use StrongPasswordEncryptor for high-strength password digesting and checking.

    Created: 20/10/2018

    Since:
    5.3.3
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String decrypt​(java.lang.String encryptedString)
      Decrypts the inputString using the encryption password.
      static java.lang.String decrypt​(java.lang.String encryptedString, java.lang.String encryptionPassword)
      Decrypts the inputString using the encryption password.
      static java.lang.String encrypt​(java.lang.String inputString)
      Encrypts the inputString using the encryption password.
      static java.lang.String encrypt​(java.lang.String inputString, java.lang.String encryptionPassword)
      Encrypts the inputString using the encryption password.
      static java.lang.String getAlgorithm()  
      static org.jasypt.encryption.ByteEncryptor getByteEncryptor​(java.lang.String encryptionPassword)  
      static org.jasypt.encryption.StringEncryptor getDefaultEncryptor()  
      static java.lang.String getPassword()  
      static org.jasypt.encryption.StringEncryptor getStringEncryptor​(java.lang.String encryptionPassword)  
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_ALGORITHM

        public static final java.lang.String DEFAULT_ALGORITHM
        See Also:
        Constant Field Values
      • ENCRYPTION_ALGORITHM_KEY

        public static final java.lang.String ENCRYPTION_ALGORITHM_KEY
        See Also:
        Constant Field Values
      • ENCRYPTION_PASSWORD_KEY

        public static final java.lang.String ENCRYPTION_PASSWORD_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • PBEncryptionUtils

        public PBEncryptionUtils()
    • Method Detail

      • getAlgorithm

        public static java.lang.String getAlgorithm()
      • getPassword

        public static java.lang.String getPassword()
      • encrypt

        public static java.lang.String encrypt​(java.lang.String inputString)
        Encrypts the inputString using the encryption password.
        Parameters:
        inputString - the string to encrypt
        Returns:
        the result of encryption
      • decrypt

        public static java.lang.String decrypt​(java.lang.String encryptedString)
        Decrypts the inputString using the encryption password.
        Parameters:
        encryptedString - the string to decrypt
        Returns:
        the result of decryption
      • encrypt

        public static java.lang.String encrypt​(java.lang.String inputString,
                                               java.lang.String encryptionPassword)
        Encrypts the inputString using the encryption password.
        Parameters:
        inputString - the string to encrypt
        encryptionPassword - the password to be used for encryption
        Returns:
        the result of encryption
      • decrypt

        public static java.lang.String decrypt​(java.lang.String encryptedString,
                                               java.lang.String encryptionPassword)
        Decrypts the inputString using the encryption password.
        Parameters:
        encryptedString - the string to decrypt
        encryptionPassword - the password used for encryption
        Returns:
        the result of decryption
      • getDefaultEncryptor

        public static org.jasypt.encryption.StringEncryptor getDefaultEncryptor()
      • getStringEncryptor

        public static org.jasypt.encryption.StringEncryptor getStringEncryptor​(java.lang.String encryptionPassword)
      • getByteEncryptor

        public static org.jasypt.encryption.ByteEncryptor getByteEncryptor​(java.lang.String encryptionPassword)