public final class FoxBaseEncryptUtils
extends java.lang.Object
author: Blankj
blog : http://blankj.com
time : 2016/08/02
desc : utils about encrypt
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decrypt3DES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of 3DES decryption.
|
static byte[] |
decryptAES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of AES decryption.
|
static byte[] |
decryptBase64_3DES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of 3DES decryption for Base64-encode bytes.
|
static byte[] |
decryptBase64AES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of AES decryption for Base64-encode bytes.
|
static byte[] |
decryptBase64DES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of DES decryption for Base64-encode bytes.
|
static byte[] |
decryptBase64RSA(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
Return the bytes of RSA decryption for Base64-encode bytes.
|
static byte[] |
decryptDES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of DES decryption.
|
static byte[] |
decryptHexString3DES(java.lang.String data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of 3DES decryption for hex string.
|
static byte[] |
decryptHexStringAES(java.lang.String data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of AES decryption for hex string.
|
static byte[] |
decryptHexStringDES(java.lang.String data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of DES decryption for hex string.
|
static byte[] |
decryptHexStringRSA(java.lang.String data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
Return the bytes of RSA decryption for hex string.
|
static byte[] |
decryptRSA(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
Return the bytes of RSA decryption.
|
static byte[] |
encrypt3DES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of 3DES encryption.
|
static byte[] |
encrypt3DES2Base64(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the Base64-encode bytes of 3DES encryption.
|
static java.lang.String |
encrypt3DES2HexString(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the hex string of 3DES encryption.
|
static byte[] |
encryptAES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of AES encryption.
|
static byte[] |
encryptAES2Base64(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the Base64-encode bytes of AES encryption.
|
static java.lang.String |
encryptAES2HexString(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the hex string of AES encryption.
|
static byte[] |
encryptDES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the bytes of DES encryption.
|
static byte[] |
encryptDES2Base64(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the Base64-encode bytes of DES encryption.
|
static java.lang.String |
encryptDES2HexString(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
Return the hex string of DES encryption.
|
static byte[] |
encryptHmacMD5(byte[] data,
byte[] key)
Return the bytes of HmacMD5 encryption.
|
static java.lang.String |
encryptHmacMD5ToString(byte[] data,
byte[] key)
Return the hex string of HmacMD5 encryption.
|
static java.lang.String |
encryptHmacMD5ToString(java.lang.String data,
java.lang.String key)
Return the hex string of HmacMD5 encryption.
|
static byte[] |
encryptHmacSHA1(byte[] data,
byte[] key)
Return the bytes of HmacSHA1 encryption.
|
static java.lang.String |
encryptHmacSHA1ToString(byte[] data,
byte[] key)
Return the hex string of HmacSHA1 encryption.
|
static java.lang.String |
encryptHmacSHA1ToString(java.lang.String data,
java.lang.String key)
Return the hex string of HmacSHA1 encryption.
|
static byte[] |
encryptHmacSHA224(byte[] data,
byte[] key)
Return the bytes of HmacSHA224 encryption.
|
static java.lang.String |
encryptHmacSHA224ToString(byte[] data,
byte[] key)
Return the hex string of HmacSHA224 encryption.
|
static java.lang.String |
encryptHmacSHA224ToString(java.lang.String data,
java.lang.String key)
Return the hex string of HmacSHA224 encryption.
|
static byte[] |
encryptHmacSHA256(byte[] data,
byte[] key)
Return the bytes of HmacSHA256 encryption.
|
static java.lang.String |
encryptHmacSHA256ToString(byte[] data,
byte[] key)
Return the hex string of HmacSHA256 encryption.
|
static java.lang.String |
encryptHmacSHA256ToString(java.lang.String data,
java.lang.String key)
Return the hex string of HmacSHA256 encryption.
|
static byte[] |
encryptHmacSHA384(byte[] data,
byte[] key)
Return the bytes of HmacSHA384 encryption.
|
static java.lang.String |
encryptHmacSHA384ToString(byte[] data,
byte[] key)
Return the hex string of HmacSHA384 encryption.
|
static java.lang.String |
encryptHmacSHA384ToString(java.lang.String data,
java.lang.String key)
Return the hex string of HmacSHA384 encryption.
|
static byte[] |
encryptHmacSHA512(byte[] data,
byte[] key)
Return the bytes of HmacSHA512 encryption.
|
static java.lang.String |
encryptHmacSHA512ToString(byte[] data,
byte[] key)
Return the hex string of HmacSHA512 encryption.
|
static java.lang.String |
encryptHmacSHA512ToString(java.lang.String data,
java.lang.String key)
Return the hex string of HmacSHA512 encryption.
|
static byte[] |
encryptMD2(byte[] data)
Return the bytes of MD2 encryption.
|
static java.lang.String |
encryptMD2ToString(byte[] data)
Return the hex string of MD2 encryption.
|
static java.lang.String |
encryptMD2ToString(java.lang.String data)
Return the hex string of MD2 encryption.
|
static byte[] |
encryptMD5(byte[] data)
Return the bytes of MD5 encryption.
|
static byte[] |
encryptMD5File(java.io.File file)
Return the bytes of file's MD5 encryption.
|
static byte[] |
encryptMD5File(java.lang.String filePath)
Return the bytes of file's MD5 encryption.
|
static java.lang.String |
encryptMD5File2String(java.io.File file)
Return the hex string of file's MD5 encryption.
|
static java.lang.String |
encryptMD5File2String(java.lang.String filePath)
Return the hex string of file's MD5 encryption.
|
static java.lang.String |
encryptMD5ToString(byte[] data)
Return the hex string of MD5 encryption.
|
static java.lang.String |
encryptMD5ToString(byte[] data,
byte[] salt)
Return the hex string of MD5 encryption.
|
static java.lang.String |
encryptMD5ToString(java.lang.String data)
Return the hex string of MD5 encryption.
|
static java.lang.String |
encryptMD5ToString(java.lang.String data,
java.lang.String salt)
Return the hex string of MD5 encryption.
|
static byte[] |
encryptRSA(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
Return the bytes of RSA encryption.
|
static byte[] |
encryptRSA2Base64(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
Return the Base64-encode bytes of RSA encryption.
|
static java.lang.String |
encryptRSA2HexString(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
Return the hex string of RSA encryption.
|
static byte[] |
encryptSHA1(byte[] data)
Return the bytes of SHA1 encryption.
|
static java.lang.String |
encryptSHA1ToString(byte[] data)
Return the hex string of SHA1 encryption.
|
static java.lang.String |
encryptSHA1ToString(java.lang.String data)
Return the hex string of SHA1 encryption.
|
static byte[] |
encryptSHA224(byte[] data)
Return the bytes of SHA224 encryption.
|
static java.lang.String |
encryptSHA224ToString(byte[] data)
Return the hex string of SHA224 encryption.
|
static java.lang.String |
encryptSHA224ToString(java.lang.String data)
Return the hex string of SHA224 encryption.
|
static byte[] |
encryptSHA256(byte[] data)
Return the bytes of SHA256 encryption.
|
static java.lang.String |
encryptSHA256ToString(byte[] data)
Return the hex string of SHA256 encryption.
|
static java.lang.String |
encryptSHA256ToString(java.lang.String data)
Return the hex string of SHA256 encryption.
|
static byte[] |
encryptSHA384(byte[] data)
Return the bytes of SHA384 encryption.
|
static java.lang.String |
encryptSHA384ToString(byte[] data)
Return the hex string of SHA384 encryption.
|
static java.lang.String |
encryptSHA384ToString(java.lang.String data)
Return the hex string of SHA384 encryption.
|
static byte[] |
encryptSHA512(byte[] data)
Return the bytes of SHA512 encryption.
|
static java.lang.String |
encryptSHA512ToString(byte[] data)
Return the hex string of SHA512 encryption.
|
static java.lang.String |
encryptSHA512ToString(java.lang.String data)
Return the hex string of SHA512 encryption.
|
public static java.lang.String encryptMD2ToString(java.lang.String data)
data - The data.public static java.lang.String encryptMD2ToString(byte[] data)
data - The data.public static byte[] encryptMD2(byte[] data)
data - The data.public static java.lang.String encryptMD5ToString(java.lang.String data)
data - The data.public static java.lang.String encryptMD5ToString(java.lang.String data,
java.lang.String salt)
data - The data.salt - The salt.public static java.lang.String encryptMD5ToString(byte[] data)
data - The data.public static java.lang.String encryptMD5ToString(byte[] data,
byte[] salt)
data - The data.salt - The salt.public static byte[] encryptMD5(byte[] data)
data - The data.public static java.lang.String encryptMD5File2String(java.lang.String filePath)
filePath - The path of file.public static byte[] encryptMD5File(java.lang.String filePath)
filePath - The path of file.public static java.lang.String encryptMD5File2String(java.io.File file)
file - The file.public static byte[] encryptMD5File(java.io.File file)
file - The file.public static java.lang.String encryptSHA1ToString(java.lang.String data)
data - The data.public static java.lang.String encryptSHA1ToString(byte[] data)
data - The data.public static byte[] encryptSHA1(byte[] data)
data - The data.public static java.lang.String encryptSHA224ToString(java.lang.String data)
data - The data.public static java.lang.String encryptSHA224ToString(byte[] data)
data - The data.public static byte[] encryptSHA224(byte[] data)
data - The data.public static java.lang.String encryptSHA256ToString(java.lang.String data)
data - The data.public static java.lang.String encryptSHA256ToString(byte[] data)
data - The data.public static byte[] encryptSHA256(byte[] data)
data - The data.public static java.lang.String encryptSHA384ToString(java.lang.String data)
data - The data.public static java.lang.String encryptSHA384ToString(byte[] data)
data - The data.public static byte[] encryptSHA384(byte[] data)
data - The data.public static java.lang.String encryptSHA512ToString(java.lang.String data)
data - The data.public static java.lang.String encryptSHA512ToString(byte[] data)
data - The data.public static byte[] encryptSHA512(byte[] data)
data - The data.public static java.lang.String encryptHmacMD5ToString(java.lang.String data,
java.lang.String key)
data - The data.key - The key.public static java.lang.String encryptHmacMD5ToString(byte[] data,
byte[] key)
data - The data.key - The key.public static byte[] encryptHmacMD5(byte[] data,
byte[] key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA1ToString(java.lang.String data,
java.lang.String key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA1ToString(byte[] data,
byte[] key)
data - The data.key - The key.public static byte[] encryptHmacSHA1(byte[] data,
byte[] key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA224ToString(java.lang.String data,
java.lang.String key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA224ToString(byte[] data,
byte[] key)
data - The data.key - The key.public static byte[] encryptHmacSHA224(byte[] data,
byte[] key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA256ToString(java.lang.String data,
java.lang.String key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA256ToString(byte[] data,
byte[] key)
data - The data.key - The key.public static byte[] encryptHmacSHA256(byte[] data,
byte[] key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA384ToString(java.lang.String data,
java.lang.String key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA384ToString(byte[] data,
byte[] key)
data - The data.key - The key.public static byte[] encryptHmacSHA384(byte[] data,
byte[] key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA512ToString(java.lang.String data,
java.lang.String key)
data - The data.key - The key.public static java.lang.String encryptHmacSHA512ToString(byte[] data,
byte[] key)
data - The data.key - The key.public static byte[] encryptHmacSHA512(byte[] data,
byte[] key)
data - The data.key - The key.public static byte[] encryptDES2Base64(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static java.lang.String encryptDES2HexString(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] encryptDES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decryptBase64DES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decryptHexStringDES(java.lang.String data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decryptDES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] encrypt3DES2Base64(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static java.lang.String encrypt3DES2HexString(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] encrypt3DES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decryptBase64_3DES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decryptHexString3DES(java.lang.String data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decrypt3DES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] encryptAES2Base64(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static java.lang.String encryptAES2HexString(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] encryptAES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decryptBase64AES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decryptHexStringAES(java.lang.String data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] decryptAES(byte[] data,
byte[] key,
java.lang.String transformation,
byte[] iv)
data - The data.key - The key.transformation - The name of the transformation, e.g., DES/CBC/PKCS5Padding.iv - The buffer with the IV. The contents of the
buffer are copied to protect against subsequent modification.public static byte[] encryptRSA2Base64(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
data - The data.key - The key.isPublicKey - True to use public key, false to use private key.transformation - The name of the transformation, e.g., RSA/CBC/PKCS1Padding.public static java.lang.String encryptRSA2HexString(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
data - The data.key - The key.isPublicKey - True to use public key, false to use private key.transformation - The name of the transformation, e.g., RSA/CBC/PKCS1Padding.public static byte[] encryptRSA(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
data - The data.key - The key.isPublicKey - True to use public key, false to use private key.transformation - The name of the transformation, e.g., RSA/CBC/PKCS1Padding.public static byte[] decryptBase64RSA(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
data - The data.key - The key.isPublicKey - True to use public key, false to use private key.transformation - The name of the transformation, e.g., RSA/CBC/PKCS1Padding.public static byte[] decryptHexStringRSA(java.lang.String data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
data - The data.key - The key.isPublicKey - True to use public key, false to use private key.transformation - The name of the transformation, e.g., RSA/CBC/PKCS1Padding.public static byte[] decryptRSA(byte[] data,
byte[] key,
boolean isPublicKey,
java.lang.String transformation)
data - The data.key - The key.isPublicKey - True to use public key, false to use private key.transformation - The name of the transformation, e.g., RSA/CBC/PKCS1Padding.