public class AESUtils extends Object
| Constructor and Description |
|---|
AESUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
byteArrayToHexString(byte[] bytes) |
static String |
decrypt(byte[] key256Bits,
String encrypted)
Decrypt text that was encrypted with the provided encrypt method in this class.
|
static String |
decrypt(String keyBase64,
String encrypted)
Decrypt text that was encrypted with the provided encrypt method in this class.
|
static String |
decrypt(String salt,
String password,
String input)
Decrypt text that was encrypted with the provided encrypt method in this class.
|
static String |
encrypt(byte[] key256Bits,
String plainText)
Encrypt the plain text.
|
static String |
encrypt(String key,
String plainText)
Encrypt the plain text.
|
static String |
encrypt(String salt,
String password,
String plainText)
Encrypt the plain text.
|
static String |
generateAesKey() |
static byte[] |
hexStringToByteArray(String s) |
public static String generateAesKey()
public static String decrypt(String salt, String password, String input)
salt - salt is used together with the password to construct a 256 bit SecretKeypassword - the passwordinput - the iv as a hex string followed by '$' followed by the encrypted textpublic static String decrypt(byte[] key256Bits, String encrypted)
key256Bits - 256 bit keyencrypted - encrypted textpublic static String decrypt(String keyBase64, String encrypted)
keyBase64 - 256 bit key base64 encodedencrypted - encrypted textpublic static String encrypt(byte[] key256Bits, String plainText)
key256Bits - 256 bit keyplainText - text that needs to be encryptedpublic static String encrypt(String key, String plainText)
key - 256 bit key base64 encodedplainText - text that needs to be encryptedpublic static String encrypt(String salt, String password, String plainText)
salt - salt is used together with the password to construct a 256 bit SecretKeypassword - the secret keyplainText - unencrypted textpublic static byte[] hexStringToByteArray(String s)
public static String byteArrayToHexString(byte[] bytes)
Copyright © 2016 Inbot. All Rights Reserved.