求此程序编译结果
小弟不懂JAVA,也没用环境,程序没问题,
求哪位老大帮忙给运行一下
我想知道通过解密之后的 password的值是多少
主程序
String password="3v3TaGU4x%2FkCGu0YufDbJ9cRhsAlhM3KXt789hPC3qUiuhI38yGoD6hHSeh6R34TGwnjYI6EApKXzDlj6%2BDvQQ%3D%3D";
DesSecret desSecret = new DesSecret();
String key = "Sx@!168#$%@As56";
password = desSecret.get3DESDecrypt(password, key);
调用DesSecret.class
package com.common;
import java.io.PrintStream;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.MessageDigest;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESedeKeySpec;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class DesSecret
{
public String key;
public DesSecret()
{
this.key = "eproapx";
}
private byte[] md5(String strSrc)
{
byte[] returnByte = (byte[])null;
try
{
MessageDigest md5 = MessageDigest.getInstance("MD5");
returnByte = md5.digest(strSrc.getBytes("GBK"));
}
catch (Exception e)
{
e.printStackTrace();
}
return returnByte;
}
private byte[] getEnKey(String spKey)
{
byte[] desKey = (byte[])null;
try
{
byte[] desKey1 = md5(spKey);
desKey = new byte[24];
for (int i = 0; (i < desKey1.length) && (i < 24); i++) {
desKey[i] = desKey1[i];
}
if (i < 24)
{
desKey[i] = 0;
i++;
}
}
catch (Exception e)
{
e.printStackTrace();
}
return desKey;
}
public String getBase64Encode(byte[] src)
{
String requestValue = "";
try
{
BASE64Encoder base64en = new BASE64Encoder();
requestValue = base64en.encode(src);
}
catch (Exception e)
{
e.printStackTrace();
}
return requestValue;
}
&