Package org.jasypt.util.text
Class AES256TextEncryptor
Object
org.jasypt.util.text.AES256TextEncryptor
- All Implemented Interfaces:
TextEncryptor
Utility class for easily performing high-strength encryption of texts.
This class internally holds a StandardPBEStringEncryptor
configured this way:
- Algorithm: PBEWithHMACSHA512AndAES_256".
- Key obtention iterations: 1000.
The required steps to use it are:
- Create an instance (using new).
- Set a password (using
setPassword(String)orsetPasswordCharArray(char[])). - Perform the desired
encrypt(String)ordecrypt(String)operations.
This class is thread-safe.
- Since:
- 1.9.3
- Author:
- Hoki Torres
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecrypts a message.Encrypts a message.voidsetPassword(String password) Sets a password.voidsetPasswordCharArray(char[] password) Sets a password, as a char[].
-
Constructor Details
-
AES256TextEncryptor
public AES256TextEncryptor()Creates a new instance of StrongTextEncryptor.
-
-
Method Details
-
setPassword
Sets a password.- Parameters:
password- the password to be set.
-
setPasswordCharArray
public void setPasswordCharArray(char[] password) Sets a password, as a char[].- Parameters:
password- the password to be set.
-
encrypt
Encrypts a message.- Specified by:
encryptin interfaceTextEncryptor- Parameters:
message- the message to be encrypted.- See Also:
-
decrypt
Decrypts a message.- Specified by:
decryptin interfaceTextEncryptor- Parameters:
encryptedMessage- the message to be decrypted.- See Also:
-