Package org.jasypt.util.numeric
Class AES256IntegerNumberEncryptor
Object
org.jasypt.util.numeric.AES256IntegerNumberEncryptor
- All Implemented Interfaces:
IntegerNumberEncryptor
Utility class for easily performing normal-strength encryption of BigInteger objects.
This class internally holds a StandardPBEBigIntegerEncryptor
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(BigInteger)ordecrypt(BigInteger)operations.
This class is thread-safe.
- Since:
- 1.9.3
- Author:
- Hoki Torres
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of StrongIntegerNumberEncryptor. -
Method Summary
Modifier and TypeMethodDescriptiondecrypt(BigInteger encryptedNumber) Decrypts a number.encrypt(BigInteger number) Encrypts a numbervoidsetPassword(String password) Sets a password.voidsetPasswordCharArray(char[] password) Sets a password, as a char[].
-
Constructor Details
-
AES256IntegerNumberEncryptor
public AES256IntegerNumberEncryptor()Creates a new instance of StrongIntegerNumberEncryptor.
-
-
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 number- Specified by:
encryptin interfaceIntegerNumberEncryptor- Parameters:
number- the number to be encrypted.- See Also:
-
decrypt
Decrypts a number.- Specified by:
decryptin interfaceIntegerNumberEncryptor- Parameters:
encryptedNumber- the number to be decrypted.- See Also:
-