Package org.jasypt.util.numeric
Class StrongIntegerNumberEncryptor
java.lang.Object
org.jasypt.util.numeric.StrongIntegerNumberEncryptor
- 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: PBEWithMD5AndTripleDES.
- 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.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of StrongIntegerNumberEncryptor. -
Method Summary
Modifier and TypeMethodDescriptiondecrypt
(BigInteger encryptedNumber) Decrypts a number.encrypt
(BigInteger 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
-
StrongIntegerNumberEncryptor
public StrongIntegerNumberEncryptor()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.- Since:
- 1.8
-
encrypt
Encrypts a number- Specified by:
encrypt
in interfaceIntegerNumberEncryptor
- Parameters:
number
- the number to be encrypted.- See Also:
-
decrypt
Decrypts a number.- Specified by:
decrypt
in interfaceIntegerNumberEncryptor
- Parameters:
encryptedNumber
- the number to be decrypted.- See Also:
-