public class Crypto extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Crypto.HashType
Define a hash type enumeration for strong-typing
|
Constructor and Description |
---|
Crypto() |
Modifier and Type | Method and Description |
---|---|
static String |
decryptAES(String value)
Decrypt a String with the AES encryption standard using the application secret
|
static String |
decryptAES(String value,
String privateKey)
Decrypt a String with the AES encryption standard.
|
static String |
encryptAES(String value)
Encrypt a String with the AES encryption standard using the application secret
|
static String |
encryptAES(String value,
String privateKey)
Encrypt a String with the AES encryption standard.
|
static String |
passwordHash(String input)
Create a password hash using the default hashing algorithm
|
static String |
passwordHash(String input,
Crypto.HashType hashType)
Create a password hash using specific hashing algorithm
|
static String |
sign(String message)
Sign a message using the application secret key (HMAC-SHA1)
|
static String |
sign(String message,
byte[] key)
Sign a message with a key
|
public static String sign(String message)
public static String sign(String message, byte[] key)
message
- The message to signkey
- The key to usepublic static String passwordHash(String input)
input
- The passwordpublic static String passwordHash(String input, Crypto.HashType hashType)
input
- The passwordhashType
- The hashing algorithmpublic static String encryptAES(String value)
value
- The String to encryptpublic static String encryptAES(String value, String privateKey)
value
- The String to encryptprivateKey
- The key used to encryptpublic static String decryptAES(String value)
value
- An hexadecimal encrypted stringGuillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly