加密内容:
localHashMap.put("password", Base64.encode(Des3.encryptMode(password.getBytes())));
Des3加密内容:
public class Des3
{
private static byte[] a()
{
return "chinamobile_emiswereport".getBytes();
}
public static byte[] encryptMode(byte[] paramArrayOfByte)
{
SecretKeySpec localSecretKeySpec = new SecretKeySpec(a(), "DESede");
Cipher localCipher = Cipher.getInstance("DESede");
localCipher.init(1, localSecretKeySpec);
paramArrayOfByte = localCipher.doFinal(paramArrayOfByte);
return paramArrayOfByte;
}
Base64加密内容
package com.cmcc.jx.ict.contact.util;
public class Base64
{
private static char[] a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".toCharArray();
private static byte[] b = new byte[256];
static
{
int i = 0;
if (i >= 256)
{
i = 65;
label28:
if (i <= 90) {
break label82;
}
i = 97;
label37:
if (i <= 122) {
break label99;
}
i = 48;
}
for (;;)
{
if (i > 57)
{
b[43] = 62;
b[47] = 63;
return;
b[i] = -1;
i += 1;
break;
label82:
b[i] = ((byte)(i - 65));
i += 1;
break label28;
label99:
b[i] = ((byte)(i + 26 - 97));
i += 1;
break label37;
}
b[i] = ((byte)(i + 52 - 48));
i += 1;
}
}
public static String encode(byte[] paramArrayOfByte)
{
char[] arrayOfChar1 = new char[(paramArrayOfByte.length + 2) / 3 * 4];
int i = 0;
int j = 0;
if (j >= paramArrayOfByte.length) {
return new String(arrayOfChar1);
}
int m = (paramArrayOfByte[j] & 0xFF) << 8;
if (j + 1 < paramArrayOfByte.length) {
m |= paramArrayOfByte[(j + 1)] & 0xFF;
}
for (int k = 1;; k = 0)
{
m <<= 8;
if (j + 2 < paramArrayOfByte.length) {
m |= paramArrayOfByte[(j + 2)] & 0xFF;
}
for (int n = 1;; n = 0)
{
char[] arrayOfChar2 = a;
if (n != 0)
{
n = m & 0x3F;
label117:
arrayOfChar1[(i + 3)] = arrayOfChar2[n];
m >>= 6;
arrayOfChar2 = a;
if (k == 0) {
break label215;
}
}
label215:
for (k = m & 0x3F;; k = 64)
{
arrayOfChar1[(i + 2)] = arrayOfChar2[k];
k = m >> 6;
arrayOfChar1[(i + 1)] = a[(k & 0x3F)];
arrayOfChar1[(i + 0)] = a[(k >> 6 & 0x3F)];
j += 3;
i += 4;
break;
n = 64;
break label117;
}
}
}
}
加密前的文本:15579439854
加密后的文本:MHbw2VF2a4ldo%2BWVeH1afA%3D%3D
使用易语言Des3加密一直得不到结果
.版本 2
.支持库 spec
.支持库 Javalib
调试输出 (java虚拟机.创建 (“L:\2.jar”, )) ' jni库加载
java类 = java接口.加载类 (“com.cmcc.jx.ict.contact.util.Des3”) ' env->Findclass函数
调试输出 (到文本 (java类))
加密方法标识符 = java接口.取静态方法标志符 (java类, “encryptMode”, “([B)[B”) ' env->GetMetheodID函数
调试输出 (到文本 (加密方法标识符))
逻辑 = java接口.静态方法 (java类, 加密方法标识符, 结果, “3135353739343339383534”)
调试输出 (到文本 (逻辑))
加密结果 = java接口.取字符串文本 (结果, )
调试输出 (加密结果)
调试结果为:
* 真
* “127506800”
* “168542336”
* “假”
* “”
要崩溃啦!!!求大神!!!!!
求助如何使用易语言引用jar包解密,其他方法也可以
|