public final class AESHelper extends Object
Constructor and Description |
---|
AESHelper() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decrypt(byte[] c,
String key)
Decrypts a byte[] encrypted by
encrypt(java.lang.String, java.lang.String) method. |
static String |
decrypt(String c,
String key)
Decrypts a string encrypted by
encrypt(java.lang.String, java.lang.String) method. |
static byte[] |
decryptFile(String path,
String key)
Decrypts a file encrypted by
encryptToFile(String, byte[], String) method. |
static String |
encrypt(byte[] c,
String key)
Encrypts a byte[].
|
static String |
encrypt(String c,
String key)
Encrypts a string.
|
static void |
encryptToFile(String path,
byte[] buf,
String key)
Encrypts the byte[] to a file.
|
static byte[] |
readFile(String filePath)
Reads a file.
|
public static String encrypt(String c, String key)
c
- The string to encrypt.public static String encrypt(byte[] c, String key)
c
- The byte[] to encrypt.key
- The key.public static String decrypt(String c, String key)
encrypt(java.lang.String, java.lang.String)
method.c
- The encrypted HEX string.key
- The key.public static byte[] decrypt(byte[] c, String key)
encrypt(java.lang.String, java.lang.String)
method.c
- The encrypted HEX byte[].key
- The key.public static byte[] decryptFile(String path, String key)
encryptToFile(String, byte[], String)
method.path
- The file path to decrypt.key
- The key.public static void encryptToFile(String path, byte[] buf, String key)
path
- The destination path.buf
- The buffer.key
- The key.public static byte[] readFile(String filePath) throws IOException
filePath
- The file path.IOException
- if an error occurs reading the file or if the file does not exists.Copyright © 2014 Feedzai. All Rights Reserved.