public final class SymmetricEncryption extends Object implements IDataEncryption
Implements standard symmetric algorithms for data encryption with single key and passphrase (salt).
Constructor and Description |
---|
SymmetricEncryption(int algorithmType,
String key)
Creates symmetric encryption algorithm with default passphrase
|
SymmetricEncryption(int algorithmType,
String key,
String salt)
Creates symmetric encryption algorithm with parameters.
|
Modifier and Type | Method and Description |
---|---|
String |
decode(String source)
Decrypts string based on provided algorithm type, key and salt parameters
|
String |
encode(String source)
Encrypts string based on provided algorithm type, key and salt parameters
|
int |
getAlgorithmType()
Gets or sets type of symmetric algorithm.
|
String |
getKey()
Gets or sets key of encryption algorithm.
|
String |
getSalt()
Gets or sets passphrase of encryption algorithm.
|
void |
setAlgorithmType(int value)
Gets or sets type of symmetric algorithm.
|
void |
setKey(String value)
Gets or sets key of encryption algorithm.
|
void |
setSalt(String value)
Gets or sets passphrase of encryption algorithm.
|
public SymmetricEncryption(int algorithmType, String key)
Creates symmetric encryption algorithm with default passphrase
algorithmType
- Specify symmetric algorithm typekey
- Encryption keypublic final String decode(String source)
Decrypts string based on provided algorithm type, key and salt parameters
decode
in interface IDataEncryption
source
- public final String encode(String source)
Encrypts string based on provided algorithm type, key and salt parameters
encode
in interface IDataEncryption
source
- Source string to encode.public final int getAlgorithmType()
Gets or sets type of symmetric algorithm.
public final String getKey()
Gets or sets key of encryption algorithm.
public final String getSalt()
Gets or sets passphrase of encryption algorithm.
public final void setAlgorithmType(int value)
Gets or sets type of symmetric algorithm.
public final void setKey(String value)
Gets or sets key of encryption algorithm.
public final void setSalt(String value)
Gets or sets passphrase of encryption algorithm.