public class AES extends Object
AES加密算法/ECB 模式/NoPadding 填充 NOTE: jdk jce must enabled cp local_policy.jar,US_export_policy.jar $JAVA_HOME/jre/lib/security/ without jce: java.security.InvalidKeyException: Illegal key size or default parameters
限定符和类型 | 字段和说明 |
---|---|
static String |
ALGORITHM
加密算法使用 AES
|
static String |
CHARSET |
static String |
CIPHER_ALGORITHM
加密/解密算法/工作模式/填充方式
JAVA6 支持PKCS5PADDING填充方式, Bouncy castle支持PKCS7Padding填充方式
|
构造器和说明 |
---|
AES() |
限定符和类型 | 方法和说明 |
---|---|
static byte[] |
decrypt(byte[] hexContentBytes,
byte[] passwdBytes) |
static String |
decrypt(String content,
String passwd)
AES解密
|
static byte[] |
encrypt(byte[] hexContentBytes,
byte[] passwdBytes) |
static String |
encrypt(String content,
String passwd)
AES加密
|
static void |
main(String[] args) |
public static final String CIPHER_ALGORITHM
public static byte[] decrypt(byte[] hexContentBytes, byte[] passwdBytes)
public static String decrypt(String content, String passwd)
content
- 十六进制字符串passwd
- 密钥public static byte[] encrypt(byte[] hexContentBytes, byte[] passwdBytes)
public static String encrypt(String content, String passwd)
content
- 明文passwd
- 密钥Copyright © 2015 jiucai.org. All rights reserved.