Class StringEncryptor

java.lang.Object
com.axelor.common.crypto.StringEncryptor
All Implemented Interfaces:
Encryptor<String,String>

@Deprecated public class StringEncryptor extends Object implements Encryptor<String,String>
Deprecated.
Backed by BytesEncryptor, which uses weak key derivation (PBKDF2WithHmacSHA1, 1024 iterations) and an instance-scoped salt. Use StringEncryptorPbkdf2Sha512 (or StringEncryptorPbkdf2Sha256) for new encryptions, or StringEncryptorCoordinator to handle legacy $AES$, $AESv1$, and $AESv2$ ciphertext transparently.
AES encryptor operating on String values.

Encrypts and decrypts strings by delegating to a BytesEncryptor and encoding the resulting bytes as Base64.

  • Constructor Details

    • StringEncryptor

      public StringEncryptor(BytesEncryptor encryptor)
      Deprecated.
  • Method Details

    • cbc

      public static StringEncryptor cbc(String password)
      Deprecated.
    • gcm

      public static StringEncryptor gcm(String password)
      Deprecated.
    • isEncrypted

      public boolean isEncrypted(String message)
      Deprecated.
      Description copied from interface: Encryptor
      Check whether the given message is already encrypted or not.
      Specified by:
      isEncrypted in interface Encryptor<String,String>
      Parameters:
      message - the message to check
      Returns:
      true if encrypted
    • encrypt

      public String encrypt(String message)
      Deprecated.
      Description copied from interface: Encryptor
      Encrypt the given message.
      Specified by:
      encrypt in interface Encryptor<String,String>
      Parameters:
      message - the message to encrypt
      Returns:
      encrypted message
    • decrypt

      public String decrypt(String encryptedMessage)
      Deprecated.
      Description copied from interface: Encryptor
      Decrypt the given encrypted message.
      Specified by:
      decrypt in interface Encryptor<String,String>
      Parameters:
      encryptedMessage - the encrypted message to decrypt
      Returns:
      decrypted message
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object