EncryptUtil

open class EncryptUtil
    author: Blankj
    blog  : http://blankj.com
    time  : 2016/8/2
    desc  : 加密解密相关的工具类

Functions

decrypt3DES
Link copied to clipboard
open fun decrypt3DES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
3DES解密
decryptAES
Link copied to clipboard
open fun decryptAES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
AES解密
decryptBase64_3DES
Link copied to clipboard
open fun decryptBase64_3DES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
3DES解密Base64编码密文
decryptBase64AES
Link copied to clipboard
open fun decryptBase64AES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
AES解密Base64编码密文
decryptBase64DES
Link copied to clipboard
open fun decryptBase64DES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
DES解密Base64编码密文
decryptDES
Link copied to clipboard
open fun decryptDES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
DES解密
decryptHexString3DES
Link copied to clipboard
open fun decryptHexString3DES(data: String, key: Array<Byte>): Array<Byte>
3DES解密16进制密文
decryptHexStringAES
Link copied to clipboard
open fun decryptHexStringAES(data: String, key: Array<Byte>): Array<Byte>
AES解密16进制密文
decryptHexStringDES
Link copied to clipboard
open fun decryptHexStringDES(data: String, key: Array<Byte>): Array<Byte>
DES解密16进制密文
desTemplate
Link copied to clipboard
open fun desTemplate(data: Array<Byte>, key: Array<Byte>, algorithm: String, transformation: String, isEncrypt: Boolean): Array<Byte>
DES加密模板
encrypt3DES
Link copied to clipboard
open fun encrypt3DES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
3DES加密
encrypt3DES2Base64
Link copied to clipboard
open fun encrypt3DES2Base64(data: Array<Byte>, key: Array<Byte>): Array<Byte>
3DES加密后转为Base64编码
encrypt3DES2HexString
Link copied to clipboard
open fun encrypt3DES2HexString(data: Array<Byte>, key: Array<Byte>): String
3DES加密后转为16进制
encryptAES
Link copied to clipboard
open fun encryptAES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
AES加密
encryptAES2Base64
Link copied to clipboard
open fun encryptAES2Base64(data: Array<Byte>, key: Array<Byte>): Array<Byte>
AES加密后转为Base64编码
encryptAES2HexString
Link copied to clipboard
open fun encryptAES2HexString(data: Array<Byte>, key: Array<Byte>): String
AES加密后转为16进制
encryptDES
Link copied to clipboard
open fun encryptDES(data: Array<Byte>, key: Array<Byte>): Array<Byte>
DES加密
encryptDES2Base64
Link copied to clipboard
open fun encryptDES2Base64(data: Array<Byte>, key: Array<Byte>): Array<Byte>
DES加密后转为Base64编码
encryptDES2HexString
Link copied to clipboard
open fun encryptDES2HexString(data: Array<Byte>, key: Array<Byte>): String
DES加密后转为16进制
encryptHmacMD5
Link copied to clipboard
open fun encryptHmacMD5(data: Array<Byte>, key: Array<Byte>): Array<Byte>
HmacMD5加密
encryptHmacMD5ToString
Link copied to clipboard
open fun encryptHmacMD5ToString(data: Array<Byte>, key: Array<Byte>): String
HmacMD5加密
open fun encryptHmacMD5ToString(data: String, key: String): String
HmacMD5加密
encryptHmacSHA1
Link copied to clipboard
open fun encryptHmacSHA1(data: Array<Byte>, key: Array<Byte>): Array<Byte>
HmacSHA1加密
encryptHmacSHA1ToString
Link copied to clipboard
open fun encryptHmacSHA1ToString(data: Array<Byte>, key: Array<Byte>): String
HmacSHA1加密
open fun encryptHmacSHA1ToString(data: String, key: String): String
HmacSHA1加密
encryptHmacSHA224
Link copied to clipboard
open fun encryptHmacSHA224(data: Array<Byte>, key: Array<Byte>): Array<Byte>
HmacSHA224加密
encryptHmacSHA224ToString
Link copied to clipboard
open fun encryptHmacSHA224ToString(data: Array<Byte>, key: Array<Byte>): String
HmacSHA224加密
open fun encryptHmacSHA224ToString(data: String, key: String): String
HmacSHA224加密
encryptHmacSHA256
Link copied to clipboard
open fun encryptHmacSHA256(data: Array<Byte>, key: Array<Byte>): Array<Byte>
HmacSHA256加密
encryptHmacSHA256ToString
Link copied to clipboard
open fun encryptHmacSHA256ToString(data: Array<Byte>, key: Array<Byte>): String
HmacSHA256加密
open fun encryptHmacSHA256ToString(data: String, key: String): String
HmacSHA256加密
encryptHmacSHA384
Link copied to clipboard
open fun encryptHmacSHA384(data: Array<Byte>, key: Array<Byte>): Array<Byte>
HmacSHA384加密
encryptHmacSHA384ToString
Link copied to clipboard
open fun encryptHmacSHA384ToString(data: Array<Byte>, key: Array<Byte>): String
HmacSHA384加密
open fun encryptHmacSHA384ToString(data: String, key: String): String
HmacSHA384加密
encryptHmacSHA512
Link copied to clipboard
open fun encryptHmacSHA512(data: Array<Byte>, key: Array<Byte>): Array<Byte>
HmacSHA512加密
encryptHmacSHA512ToString
Link copied to clipboard
open fun encryptHmacSHA512ToString(data: Array<Byte>, key: Array<Byte>): String
HmacSHA512加密
open fun encryptHmacSHA512ToString(data: String, key: String): String
HmacSHA512加密
encryptMD2
Link copied to clipboard
open fun encryptMD2(data: Array<Byte>): Array<Byte>
MD2加密
encryptMD2ToString
Link copied to clipboard
open fun encryptMD2ToString(data: Array<Byte>): String
MD2加密
open fun encryptMD2ToString(data: String): String
MD2加密
encryptMD5
Link copied to clipboard
open fun encryptMD5(data: Array<Byte>): Array<Byte>
MD5加密
encryptMD5File
Link copied to clipboard
open fun encryptMD5File(file: File): Array<Byte>
MD5加密文件
open fun encryptMD5File(filePath: String): Array<Byte>
MD5加密文件
encryptMD5File2String
Link copied to clipboard
open fun encryptMD5File2String(file: File): String
MD5加密文件
open fun encryptMD5File2String(filePath: String): String
MD5加密文件
encryptMD5ToString
Link copied to clipboard
open fun encryptMD5ToString(data: Array<Byte>): String
MD5加密
open fun encryptMD5ToString(data: String): String
MD5加密
open fun encryptMD5ToString(data: Array<Byte>, salt: Array<Byte>): String
MD5加密
open fun encryptMD5ToString(data: String, salt: String): String
MD5加密
encryptSHA1
Link copied to clipboard
open fun encryptSHA1(data: Array<Byte>): Array<Byte>
SHA1加密
encryptSHA1ToString
Link copied to clipboard
open fun encryptSHA1ToString(data: Array<Byte>): String
SHA1加密
open fun encryptSHA1ToString(data: String): String
SHA1加密
encryptSHA224
Link copied to clipboard
open fun encryptSHA224(data: Array<Byte>): Array<Byte>
SHA224加密
encryptSHA224ToString
Link copied to clipboard
open fun encryptSHA224ToString(data: Array<Byte>): String
SHA224加密
open fun encryptSHA224ToString(data: String): String
SHA224加密
encryptSHA256
Link copied to clipboard
open fun encryptSHA256(data: Array<Byte>): Array<Byte>
SHA256加密
encryptSHA256ToString
Link copied to clipboard
open fun encryptSHA256ToString(data: Array<Byte>): String
SHA256加密
open fun encryptSHA256ToString(data: String): String
SHA256加密
encryptSHA384
Link copied to clipboard
open fun encryptSHA384(data: Array<Byte>): Array<Byte>
SHA384加密
encryptSHA384ToString
Link copied to clipboard
open fun encryptSHA384ToString(data: Array<Byte>): String
SHA384加密
open fun encryptSHA384ToString(data: String): String
SHA384加密
encryptSHA512
Link copied to clipboard
open fun encryptSHA512(data: Array<Byte>): Array<Byte>
SHA512加密
encryptSHA512ToString
Link copied to clipboard
open fun encryptSHA512ToString(data: Array<Byte>): String
SHA512加密
open fun encryptSHA512ToString(data: String): String
SHA512加密
isSpace
Link copied to clipboard
open fun isSpace(s: String): Boolean
判断字符串是否为null或全为空格

Properties

AES_Transformation
Link copied to clipboard
open val AES_Transformation: String
AES转变法算法名称/加密模式/填充方式加密模式有:电子密码本模式ECB、加密块链模式CBC、加密反馈模式CFB、输出反馈模式OFB填充方式有:NoPadding、ZerosPadding、PKCS5Padding
DES_Transformation
Link copied to clipboard
open val DES_Transformation: String
DES转变法算法名称/加密模式/填充方式加密模式有:电子密码本模式ECB、加密块链模式CBC、加密反馈模式CFB、输出反馈模式OFB填充方式有:NoPadding、ZerosPadding、PKCS5Padding
TripleDES_Transformation
Link copied to clipboard
open val TripleDES_Transformation: String
3DES转变法算法名称/加密模式/填充方式加密模式有:电子密码本模式ECB、加密块链模式CBC、加密反馈模式CFB、输出反馈模式OFB填充方式有:NoPadding、ZerosPadding、PKCS5Padding