package com.xx.b.a;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public final class a
{
private static final char[] a = { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70 };
public static String a(String paramString1, String paramString2)
{
try
{
MessageDigest localMessageDigest = MessageDigest.getInstance("MD5");
localMessageDigest.update(paramString1.getBytes());
byte[] arrayOfByte = localMessageDigest.digest();
StringBuilder localStringBuilder = new StringBuilder(arrayOfByte.length << 1);
for (int i = 0; ; i++)
{
if (i >= arrayOfByte.length)
{
String str = localStringBuilder.toString();
paramString1 = str;
SecretKeySpec localSecretKeySpec = new SecretKeySpec(paramString1.substring(paramString1.length() / 2).getBytes(), "AES");
Cipher localCipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
localCipher.init(1, localSecretKeySpec, new IvParameterSpec("2012061372065459".getBytes()));
return URLEncoder.encode(new String(b.a(localCipher.doFinal(paramString2.getBytes()))), "utf-8");
}
localStringBuilder.append(a[((0xF0 & arrayOfByte[i]) >>> 4)]);
localStringBuilder.append(a[(0xF & arrayOfByte[i])]);
}
}
catch (NoSuchAlgorithmException localNoSuchAlgorithmException)
{
while (true)
localNoSuchAlgorithmException.printStackTrace();
}
}
}
传进的参数1:2012241372065459
参数2:xxx1=64555550&xx2=1377601186783&xx3=128&xx4=&xx5=0
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!