- .method public static e(Ljava/lang/String;)Ljava/lang/String;
- .locals 3
-
- .line 1
- invoke-virtual {p0}, Ljava/lang/String;->getBytes()[B
-
- move-result-object p0
-
- const-string v0, "345ac9226c94523aeb2be459a5d63ce3"
-
- const-string v1, "97043ef635f60558c5c9169252b3bdc9"
-
- const-string v2, "AES/CBC/NoPadding"
-
- invoke-static {v0, v1, p0, v2}, Lcom/txket/h/g;->c(Ljava/lang/String;Ljava/lang/String;[BLjava/lang/String;)[B
-
- move-result-object p0
-
- .line 2
- invoke-static {p0}, Lcom/txket/h/t;->g([B)Ljava/lang/String;
-
- move-result-object p0
-
- return-object p0
- .end method
-
- public static byte[] c(String str, String str2, byte[] bArr, String str3) {
- byte[] e = e(str);
- try {
- IvParameterSpec ivParameterSpec = new IvParameterSpec(e(str2));
- SecretKeySpec secretKeySpec = new SecretKeySpec(e, "AES");
- Cipher instance = Cipher.getInstance(str3);
- instance.init(1, secretKeySpec, ivParameterSpec);
- return instance.doFinal(d(bArr));
- } catch (Exception e2) {
- e2.printStackTrace();
- return null;
- }
- }
- public static byte[] e(String str) {
- str = str.toLowerCase();
- char[] toCharArray = str.toCharArray();
- int length = str.length() / 2;
- byte[] bArr = new byte[length];
- for (int i = 0; i < length; i++) {
- int i2;
- int i3 = i * 2;
- if (toCharArray[i3] < ':') {
- i2 = toCharArray[i3] - 48;
- } else {
- i2 = toCharArray[i3] - 87;
- }
- i3++;
- if (toCharArray[i3] < ':') {
- i3 = toCharArray[i3] - 48;
- } else {
- i3 = toCharArray[i3] - 87;
- }
- bArr[i] = (byte) ((i2 * 16) + i3);
- }
- return bArr;
- }
算法:AES/CBC/NoPaddingS
IvParameterSpec:97043ef635f60558c5c9169252b3bdc9
SecretKeySpec:345ac9226c94523aeb2be459a5d63ce3