public class AESTools extends Object
| Constructor and Description |
|---|
AESTools() |
| Modifier and Type | Method and Description |
|---|---|
static String |
decrypt(String cipherText,
String encryptionKey,
String salt)
Decrypt the given cipher text value with the given encryption key and the same salt used for encryption using AES
CBC.
|
static String |
decryptSiv(String cipherText,
byte[] encryptionKey)
Decrypt the given cipher text value with the given encryption key using AES SIV.
|
static String |
encrypt(String plainText,
String encryptionKey,
String salt)
Encrypt the given plain text value with the given encryption key and salt using AES CBC.
|
static String |
encryptSiv(String plainText,
byte[] encryptionKey)
Encrypt the given plain text value with the given encryption key using AES SIV.
|
static String |
generateNewSalt()
Generates a new random salt
|
@Nullable public static String encrypt(String plainText, String encryptionKey, String salt)
plainText - the plain text value to encryptencryptionKey - the encryption keysalt - the salt@Nullable public static String decrypt(String cipherText, String encryptionKey, String salt)
cipherText - the hexadecimal cipher text value to decryptencryptionKey - the encryption keysalt - the salt used for encrypting this cipherText@Nullable public static String encryptSiv(String plainText, byte[] encryptionKey)
plainText - the plain text value to encryptencryptionKey - the encryption key (must be at least 32 bytes)IllegalArgumentException - if the encryption key is smaller than 32 bytes@Nullable public static String decryptSiv(String cipherText, byte[] encryptionKey)
cipherText - the cipher text value to decryptencryptionKey - the encryption key (must be at least 32 bytes)IllegalArgumentException - if the encryption key is smaller than 32 bytespublic static String generateNewSalt()
Copyright © 2012–2021 Graylog, Inc.. All rights reserved.