Package com.axelor.common.crypto
Class BytesEncryptor
java.lang.Object
com.axelor.common.crypto.BytesEncryptor
- All Implemented Interfaces:
Encryptor<byte[],byte[]>
Deprecated.
AES encryptor operating on raw byte arrays.
Uses PBKDF2WithHmacSHA1 for key derivation with a fixed iteration count of 1024 and an 8-byte
salt that is generated once at construction time and reused for every encrypt(byte[])
call.
Binary payload format:
CBC: | $AES$ (5 bytes) | salt (8 bytes) | encrypted_data | GCM: | $AES$ (5 bytes) | salt (8 bytes) | iv (16 bytes) | encrypted_data |
-
Constructor Summary
ConstructorsConstructorDescriptionBytesEncryptor(OperationMode mode, PaddingScheme paddingScheme, String password) Deprecated.BytesEncryptor(String password) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic BytesEncryptorDeprecated.byte[]decrypt(byte[] bytes) Deprecated.Decrypt the given encrypted message.byte[]encrypt(byte[] bytes) Deprecated.Encrypt the given message.static BytesEncryptorDeprecated.Deprecated.booleanisEncrypted(byte[] bytes) Deprecated.Check whether the given message is already encrypted or not.toString()Deprecated.
-
Constructor Details
-
BytesEncryptor
Deprecated. -
BytesEncryptor
Deprecated.
-
-
Method Details
-
cbc
Deprecated. -
gcm
Deprecated. -
getTransformation
Deprecated. -
isEncrypted
public boolean isEncrypted(byte[] bytes) Deprecated.Description copied from interface:EncryptorCheck whether the given message is already encrypted or not.- Specified by:
isEncryptedin interfaceEncryptor<byte[],byte[]> - Parameters:
bytes- the message to check- Returns:
- true if encrypted
-
encrypt
public byte[] encrypt(byte[] bytes) Deprecated.Description copied from interface:EncryptorEncrypt the given message. -
decrypt
public byte[] decrypt(byte[] bytes) Deprecated.Description copied from interface:EncryptorDecrypt the given encrypted message. -
toString
Deprecated.
-
BytesEncryptorPbkdf2Sha512(orBytesEncryptorPbkdf2Sha256) for new encryptions, orBytesEncryptorCoordinatorto handle legacy$AES$,$AESv1$, and$AESv2$ciphertext transparently.