public abstract class DESCoder extends SecurityCoder
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CIPHER_ALGORITHM
加密/解密算法 / 工作模式 / 填充方式
|
static String |
KEY_ALGORITHM
密钥算法
Java 6 只支持56bit密钥 Bouncy Castle 支持64bit密钥 |
| 构造器和说明 |
|---|
DESCoder() |
public static final String KEY_ALGORITHM
public static byte[] decrypt(byte[] data,
byte[] key)
throws InvalidKeyException,
NoSuchAlgorithmException,
InvalidKeySpecException,
NoSuchPaddingException,
IllegalBlockSizeException,
BadPaddingException
data - 待解密数据key - 密钥InvalidKeySpecExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionNoSuchPaddingExceptionBadPaddingExceptionIllegalBlockSizeExceptionpublic static byte[] encrypt(byte[] data,
byte[] key)
throws NoSuchAlgorithmException,
NoSuchPaddingException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException,
InvalidKeySpecException
data - 待加密数据key - 密钥NoSuchPaddingExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionBadPaddingExceptionIllegalBlockSizeExceptionInvalidKeySpecExceptionpublic static byte[] initKey()
throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionCopyright © 2017. All rights reserved.