求助 一段java程序 希望能帮助翻译一下
package org.jfree.xml.util;
import javax.crypto.Cipher;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class TestJava
{
//会员密码加密
public static String getEncryptString(String s)
{
String s1;
BASE64Encoder BASE64Encoder = new BASE64Encoder();
s1 = BASE64Encoder.encode(n.a()._mthnew(s.getBytes()));
return s1;
}
//会员密码解密
public static String getDecryptString(String s)throws Exception
{
String s1;
BASE64Decoder BASE64Decoder = new BASE64Decoder();
s1 = new String(n.a()._mthif(BASE64Decoder.decodeBuffer(s)));
return s1;
}
//用户名身份证解密
public static String ec(String s)throws Exception
{
byte _fldint[] = { -87, -101, -56, 50, 86, 53, -29, 3};
String Key="123!@#qweQWE/.,?><abc";
PBEParameterSpec pbeparameterspec = new PBEParameterSpec(_fldint,19);
PBEKeySpec pbekeyspec = new PBEKeySpec(Key.toCharArray());
SecretKeyFactory secretkeyfactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
javax.crypto.SecretKey secretkey = secretkeyfactory.generateSecret(pbekeyspec);
Cipher cipher = Cipher.getInstance("PBEWithMD5AndDES");
cipher.init(Cipher.ENCRYPT_MODE, secretkey, pbeparameterspec);
byte abyte1[] = s.getBytes("UTF8");
byte abyte2[] = cipher.doFinal(abyte1);
BASE64Encoder BASE64Encoder = new BASE64Encoder();
return BASE64Encoder.encode(abyte2);
}
//用户名身份证解密
public static String ed(String s)throws Exception
{
String Key="123!@#qweQWE/.,?><abc";
byte _fldint[] = { -87, -101, -56, 50, 86, 53, -29, 3};
BASE64Decoder BASE64Decoder = new BASE64Decoder();
byte abyte9[] = BASE64Decoder.decodeBuffer(s);
PBEParameterSpec pbeparameterspec = new PBEParameterSpec(_fldint,19);
PBEKeySpec pbekeyspec = new PBEKeySpec(Key.toCharArray());
SecretKeyFactory secretkeyfactory = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
javax.crypto.SecretKey secretkey = secretkeyfactory.generateSecret(pbekeyspec);
Cipher cipher = Cipher.getInstance("PBEWithMD5AndDES");
cipher.init(2, secretkey, pbeparameterspec);
byte abyte2[] = cipher.doFinal(abyte9);
return new String(abyte2, "UTF8");
}
public static void main(String args[]) throws Exception
{
String CID="颜海福";
String S1="123456";
//会员密码加解密
System.out.println("会员密码加密(a.dll):"+S1+"="+ getEncryptString(S1));
System.out.println("会员密码解密(a.dll):ETLCw4cN="+ getDecryptString("ETLCw4cN"));
//用户名/身份证加解密
System.out.println(CID+"会员姓名加密:"+ ec(CID));
System.out.println("会员姓名解密:"+ ed("zjRKUPythm4nf8HgiBvQlQ=="));
System.out.println("Pubwin2007加密算法研究QQ群号:76191863,QQ:4869911");
System.exit(0);
}
//
}
需要写一个小程序 能转移会员的资料
需要读出会员的密码
找到人家写的一段java的程序
但是我看不懂
我只会vb 对java一点都不懂
哪位大哥大姐能帮我翻译一下啊
我先知道这个加密算法
然后我用vb来写出来
看到里面好像要调用一个a.dll
希望得到你们的帮助
万分感谢