public abstract class DesUtil2 extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CIPHER_ALGORITHM
加密/解密算法/工作模式/填充方式
|
static String |
KEY_ALGORITHM
密钥算法
|
| Constructor and Description |
|---|
DesUtil2() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(byte[] data,
byte[] key)
解密
|
static byte[] |
encrypt(byte[] data,
byte[] key)
加密
|
static byte[] |
initKey()
生成密钥
|
static Key |
toKey(byte[] key)
转换密钥
|
public static final String KEY_ALGORITHM
public static final String CIPHER_ALGORITHM
public static Key toKey(byte[] key) throws Exception
key - 二进制密钥Exceptionpublic static byte[] decrypt(byte[] data,
byte[] key)
throws Exception
data - 待解密数据key - 密钥Exceptionpublic static byte[] encrypt(byte[] data,
byte[] key)
throws Exception
data - 待加密数据key - 密钥ExceptionCopyright © 2018. All rights reserved.