public class EncryptionServices
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
EncryptionServices() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decrypt(java.lang.String message)
Deprecated.
from V5.3 use
decryptAES(String) instead |
static java.lang.String |
decrypt(java.lang.String message,
int count,
java.lang.String key)
Deprecated.
from V5.3 use
decryptAES(String, String) instead |
static java.lang.String |
decryptAES(java.lang.String message)
Decrypts a Base64 encoded string represented by
message using the AES algorithm and a 128 bit key with default encryption parameters. |
static java.lang.String |
decryptAES(java.lang.String message,
java.lang.String key)
Decrypts a Base64 encoded string represented by
message using the AES algorithm and a 128 bit key. |
static java.lang.String |
decryptAES(java.lang.String message,
java.lang.String key,
int iterations)
Decrypts a Base64 encoded string represented by
message using the AES algorithm and a 128 bit key. |
static java.lang.String |
encrypt(java.lang.String message)
Deprecated.
from V5.3 use
encryptAES(String) instead |
static java.lang.String |
encrypt(java.lang.String message,
int count,
java.lang.String key)
Deprecated.
from V5.3 use
encryptAES(String, String) instead |
static java.lang.String |
encryptAES(java.lang.String message)
Returns a Base64 encoded Encrypted string represented by
message using the AES algorithm and a 128 bit key with default encryption parameters. |
static java.lang.String |
encryptAES(java.lang.String message,
java.lang.String key)
Returns a Base64 encoded Encrypted string represented by
message using the AES algorithm and a 128 bit key. |
static java.lang.String |
encryptAES(java.lang.String message,
java.lang.String key,
int iterations)
Returns a Base64 encoded Encrypted string represented by
message using the AES algorithm and a 128 bit key. |
static java.lang.String |
generateHash(java.lang.String message,
int iterations,
java.lang.String salt)
Hashes a string represented by
message using the PBKDF2WithHmacSHA512 algorithm and a 512 bit key. |
public static java.lang.String generateHash(java.lang.String message, int iterations, java.lang.String salt) throws com.ebasetech.xi.exceptions.FormRuntimeException
message
using the PBKDF2WithHmacSHA512 algorithm and a 512 bit key.message
- The message to be hashediterations
- The iterations argument specifies how many times the PBKDF2 executes its underlying algorithm. A higher value is safersalt
- should be random data and vary for each user. Remember to save the salt with the hashed passwordcom.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurspublic static java.lang.String encryptAES(java.lang.String message, java.lang.String key, int iterations) throws com.ebasetech.xi.exceptions.FormRuntimeException
message
using the AES algorithm and a 128 bit key.message
- string to be encryptedkey
- key used by the encryption algorithm; if null, the default is used (see encryptAES(String)
)iterations
- number of times to encrypt the string. This number must be 1 or greatercom.ebasetech.xi.exceptions.FormRuntimeException
- if any error occursencryptAES(String)
,
encryptAES(String, String)
public static java.lang.String encryptAES(java.lang.String message, java.lang.String key) throws com.ebasetech.xi.exceptions.FormRuntimeException
message
using the AES algorithm and a 128 bit key.message
- string to be encryptedkey
- key used by the encryption algorithm; if null, the default is used (see encryptAES(String)
)com.ebasetech.xi.exceptions.FormRuntimeException
- if any error occursencryptAES(String)
public static java.lang.String encryptAES(java.lang.String message) throws com.ebasetech.xi.exceptions.FormRuntimeException
message
using the AES algorithm and a 128 bit key with default encryption parameters.message
- the string to be encryptedcom.ebasetech.xi.exceptions.FormRuntimeException
- if any error occursencryptAES(String, String)
public static java.lang.String decryptAES(java.lang.String message, java.lang.String key, int iterations) throws com.ebasetech.xi.exceptions.FormRuntimeException
message
using the AES algorithm and a 128 bit key.message
- Base64 encoded string to be decryptedkey
- key used by the decrytion algorithm; if null, the default is used (see decryptAES(String)
)iterations
- number of times to decrypt the encrypted string. The number of iterations must match the iterations when encrypting the string.com.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs, usually the message is not in the correct encrypted formatdecryptAES(String)
,
decryptAES(String, String)
,
encryptAES(String, String, int)
public static java.lang.String decryptAES(java.lang.String message, java.lang.String key) throws com.ebasetech.xi.exceptions.FormRuntimeException
message
using the AES algorithm and a 128 bit key.message
- Base64 encoded string to be decryptedkey
- key used by the decrytion algorithm; if null, the default is used (see decryptAES(String)
)com.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs, usually the message is not in the correct encrypted formatdecryptAES(String)
public static java.lang.String decryptAES(java.lang.String message) throws com.ebasetech.xi.exceptions.FormRuntimeException
message
using the AES algorithm and a 128 bit key with default encryption parameters.message
- the string to be decryptedcom.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs, usually the message is not in the correct encrypted formatdecryptAES(String, String)
@Deprecated public static java.lang.String encrypt(java.lang.String message, int count, java.lang.String key) throws com.ebasetech.xi.exceptions.FormRuntimeException
encryptAES(String, String)
insteadmessage
using the PBEWithMD5AndDES algorithm.message
- string to be encryptedcount
- number of times the encryption algorithm is invokedkey
- key used by the encryption algorithm; if null, the default is used (see encrypt(String)
)com.ebasetech.xi.exceptions.FormRuntimeException
- if any error occursencrypt(String)
@Deprecated public static java.lang.String encrypt(java.lang.String message) throws com.ebasetech.xi.exceptions.FormRuntimeException
encryptAES(String)
insteadmessage
using the PBEWithMD5AndDES algorithm and with default encryption parameters.message
- the string to be encryptedcom.ebasetech.xi.exceptions.FormRuntimeException
- if any error occursencrypt(String, int, String)
@Deprecated public static java.lang.String decrypt(java.lang.String message, int count, java.lang.String key) throws com.ebasetech.xi.exceptions.FormRuntimeException
decryptAES(String, String)
insteadmessage
using the PBEWithMD5AndDES algorithm.message
- string to be decryptedcount
- number of times the encryption algorithm is invokedkey
- key used by the decrytion algorithm; if null, the default is used (see decrypt(String)
)com.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs, usually the message is not in the correct encrypted formatdecrypt(String)
@Deprecated public static java.lang.String decrypt(java.lang.String message) throws com.ebasetech.xi.exceptions.FormRuntimeException
decryptAES(String)
insteadmessage
using the PBEWithMD5AndDES algorithm and with default encryption parameters.message
- the string to be decryptedcom.ebasetech.xi.exceptions.FormRuntimeException
- if any error occurs, usually the message is not in the correct encrypted formatdecrypt(String, int, String)