public class OAEncryption extends Object
Constructor and Description |
---|
OAEncryption() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decrypt(byte[] bs)
Decrypt bytes into a new byte array.
|
static byte[] |
decrypt(byte[] bs,
String password) |
static String |
decrypt(String inputBase64)
Decrypt a base64 string to a string.
|
static String |
decrypt(String inputBase64,
String password) |
static byte[] |
encrypt(byte[] bs)
Encrypt bytes into a new byte array.
|
static byte[] |
encrypt(byte[] bs,
String password) |
static String |
encrypt(String input)
Encrypt a string to a Base64 string.
|
static String |
encrypt(String input,
String password) |
static Cipher |
getCipher() |
static String |
getHash(String input) |
static String |
getMD5Hash(String input) |
static SecretKey |
getSecretKey()
DES secret key used for encrypting data.
|
static SecretKey |
getSecretKey(String password) |
static String |
getSHAHash(String input)
Generates a SHA-256 hash code base64 string for a given input.
|
static void |
main(String[] args) |
public static String getSHAHash(String input)
public static byte[] encrypt(byte[] bs) throws Exception
Exception
decrypt(byte[])
public static byte[] decrypt(byte[] bs) throws Exception
Exception
encrypt(byte[])
public static SecretKey getSecretKey() throws Exception
Exception
public static SecretKey getSecretKey(String password) throws Exception
Exception
public static String encrypt(String input) throws Exception
Exception
public static String encrypt(String input, String password) throws Exception
Exception
public static String decrypt(String inputBase64) throws Exception
Exception
public static String decrypt(String inputBase64, String password) throws Exception
Exception
Copyright © 1999–2019 ViaOA. All rights reserved.