Package org.jasypt.util.numeric
Class AES256DecimalNumberEncryptor
java.lang.Object
org.jasypt.util.numeric.AES256DecimalNumberEncryptor
- All Implemented Interfaces:
DecimalNumberEncryptor
Utility class for easily performing normal-strength encryption of BigDecimal objects.
This class internally holds a StandardPBEBigDecimalEncryptor
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(BigDecimal)
ordecrypt(BigDecimal)
operations.
This class is thread-safe.
- Since:
- 1.9.3
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of StrongDecimalNumberEncryptor. -
Method Summary
Modifier and TypeMethodDescriptiondecrypt
(BigDecimal encryptedNumber) Decrypts a number.encrypt
(BigDecimal number) Encrypts a numbervoid
setPassword
(String password) Sets a password.void
setPasswordCharArray
(char[] password) Sets a password, as a char[].
-
Field Details
-
encryptor
-
-
Constructor Details
-
AES256DecimalNumberEncryptor
public AES256DecimalNumberEncryptor()Creates a new instance of StrongDecimalNumberEncryptor.
-
-
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:
encrypt
in interfaceDecimalNumberEncryptor
- Parameters:
number
- the number to be encrypted.- See Also:
-
decrypt
Decrypts a number.- Specified by:
decrypt
in interfaceDecimalNumberEncryptor
- Parameters:
encryptedNumber
- the number to be decrypted.- See Also:
-