key iv是对称算法么?没看懂不过给你一个注释好的代码
public static String az(String paramString1, String paramString2) {
//声明object对象
Object localObject = "";
//声明8位的byte对象
byte[] arrayOfByte1 = new byte[8];
try {
//转换编码格式为UTF-8
byte[] arrayOfByte2 = paramString1.getBytes("UTF-8");
//判断长度是否为8
if (arrayOfByte2.length < 8) {
//为使处理字符长度为8位,进行数组复制将arrayOfByte2的值复制给arrayOfByte1
System.arraycopy(arrayOfByte2, 0, arrayOfByte1, 0,
arrayOfByte2.length);
//为arrayOfByte1数组空位补0
for (int i = arrayOfByte2.length; i < 8; i++)
arrayOfByte1[i] = 0;
}
//为使处理字符长度为8位,进行数组复制将arrayOfByte2的值复制给arrayOfByte1
System.arraycopy(arrayOfByte2, 0, arrayOfByte1, 0, 8);
//声明加密处理类,并指定转换名称
Cipher localCipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
//用密钥和向量初始化此加密对象
localCipher.init(1, new SecretKeySpec(arrayOfByte1, "DES"),
new IvParameterSpec(arrayOfByte1));
//???不懂????
String str = d
.h(localCipher.doFinal(paramString2.getBytes("UTF-8")));
localObject = str;
return localObject;
} catch (Exception localException) {
while (true)
localException.printStackTrace();
}
}