展开全部
虽然不知道你说的双倍长是什么意思,这是我自己用的3des工具类
密文是把byte数组转化成16进制字62616964757a686964616fe58685e5aeb931333335336537符串,一个byte对应两个数字,不知道是不是你说的双倍
/**
* DESede(3DES)加解密整理--pangjs 2013.12.04
*/
public class DESede {
/** 定义加密算法。 可用 DES,DESede,Blowfish*/
private static final String Algorithm = "DESede";
private static final char[] hex = "0123456789abcdef".toCharArray();
public static final String keyStr = StringUtil.DeviceKey;
/**必须是24位*/
private static byte[] key = strToBytes(keyStr);
/**
* 加密,参数有问题返回null
* @param src 明文
* @return 16进制字符串密文
*/
public static String encrypt(String src) {
if(src == null){
return null;
}
try {
byte[] origin = src.getBytes("