Package bi.deep
Class EncryptionUtils
- java.lang.Object
-
- bi.deep.EncryptionUtils
-
public class EncryptionUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description EncryptionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]decode64(String str)static Stringdecrypt(byte[] encryptedData, SecretKey secretKey)static StringdecryptBase64(String encryptedData, SecretKey secretKey)static Stringencode64(byte[] bytes)static byte[]encrypt(String data, SecretKey secretKey)static StringencryptBase64(String data, SecretKey secretKey)static SecretKeygenerateAESKey()static SecretKeygetSecretKey()static voidmain(String[] args)
-
-
-
Field Detail
-
base64key
public static final String base64key
- See Also:
- Constant Field Values
-
-
Method Detail
-
encode64
public static String encode64(byte[] bytes)
-
decode64
public static byte[] decode64(String str)
-
getSecretKey
public static SecretKey getSecretKey()
-
generateAESKey
public static SecretKey generateAESKey() throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
-
encrypt
public static byte[] encrypt(String data, SecretKey secretKey) throws Exception
- Throws:
Exception
-
encryptBase64
public static String encryptBase64(String data, SecretKey secretKey) throws Exception
- Throws:
Exception
-
decrypt
public static String decrypt(byte[] encryptedData, SecretKey secretKey) throws Exception
- Throws:
Exception
-
decryptBase64
public static String decryptBase64(String encryptedData, SecretKey secretKey) throws Exception
- Throws:
Exception
-
main
public static void main(String[] args) throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
-
-