public class DES extends Object
DES加密工具
基于DES加解密实现的加密工具,该工具可以进行可逆加密,加密时的秘钥很重要,一定要自己改秘钥,打死也不要告诉其他人。 该工具是一个线程安全类的工具。Constructor and Description |
---|
DES() |
Modifier and Type | Method and Description |
---|---|
static String |
decrypt(String data)
用默认的密码进行数据解密
|
static String |
decrypt(String key,
String data)
对输入的数据进行解密
|
static String |
encrypt(String data)
用默认的密码进行数据加密
|
static String |
encrypt(String key,
String data)
对输入的数据进行加密
|
public static final String encrypt(String key, String data)
key
- 加密的密钥,如果为空则以默认密码进行加密,如果密钥长度不是8的倍数,系统会自动补0data
- 需要加密的数据public static final String encrypt(String data)
data
- 需要加密的数据public static final String decrypt(String key, String data)
key
- 解密的密钥,如果为空则以默认密码进行加密,如果密钥长度不是8的倍数,系统会自动补0data
- 需要解密的数据Copyright © 2021. All rights reserved.