public class DESUtil extends Object
| 构造器和说明 |
|---|
DESUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
decode(String yzh3DesKey,
String data,
Charset charset)
3DES解密
解密报错 javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
不需要进行urldecode,使用如下解密代码
byte[] dec64 = Base64.decodeBase64(notifyResponse.getData());
|
static String |
encode(String yzh3DesKey,
String data,
Charset charset)
3DES加密
|
static byte[] |
tripleDesDecrypt(byte[] content,
byte[] key) |
protected static byte[] |
tripleDesDecrypt(byte[] content,
byte[] key,
byte[] icv) |
static byte[] |
tripleDesEncrypt(byte[] content,
byte[] key) |
protected static byte[] |
tripleDesEncrypt(byte[] content,
byte[] key,
byte[] icv) |
public static String encode(String yzh3DesKey, String data, Charset charset) throws Exception
yzh3DesKey - 密钥data - 数据Exception - 通用异常public static String decode(String yzh3DesKey, String data, Charset charset) throws Exception
解密报错 javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher 不需要进行urldecode,使用如下解密代码 byte[] dec64 = Base64.decodeBase64(notifyResponse.getData());
yzh3DesKey - 密钥data - 加密数据Exception - 通用异常public static byte[] tripleDesEncrypt(byte[] content,
byte[] key)
throws Exception
Exceptionprotected static byte[] tripleDesEncrypt(byte[] content,
byte[] key,
byte[] icv)
throws Exception
Exceptionpublic static byte[] tripleDesDecrypt(byte[] content,
byte[] key)
throws Exception
ExceptionCopyright © 2025. All rights reserved.