制作一个CDKey之类的东西,验证你们的服务器,而且加密算法要严格。

解决方案 »

  1.   

    同意4楼的说法  和他的mac地址绑定 就ok
      

  2.   

    项目本身 采用封包  比如对源码进行加密  然后可以绑mac之类的 
      

  3.   

    // 获取MAC地址的方法
    private static String getMACAddress(InetAddress ia) throws Exception {
    // 获得网络接口对象(即网卡),并得到mac地址,mac地址存在于一个byte数组中。
    byte[] mac = NetworkInterface.getByInetAddress(ia).getHardwareAddress();
    // 下面代码是把mac地址拼装成String
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < mac.length; i++) {
    if (i != 0) {
    sb.append("-");
    }
    // mac[i] & 0xFF 是为了把byte转化为正整数
    String s = Integer.toHexString(mac[i] & 0xFF);
    sb.append(s.length() == 1 ? 0 + s : s);
    }
    // 把字符串所有小写字母改为大写成为正规的mac地址并返回
    return sb.toString().toUpperCase();
    }
    用MAC 地址,然后用RAS 加密
      

  4.   

      String path=Thread.currentThread().getContextClassLoader().getResource(".").getPath();
            BufferedReader in= 
              new BufferedReader(new InputStreamReader(new FileInputStream(path+"Lh_AIG_Enc_RSA.dat")));
            String ctext=in.readLine();
            BigInteger c=new BigInteger(ctext);
            //获取私钥 
            FileInputStream f=new FileInputStream(path+"RSA_priv.dat");
            ObjectInputStream b=new ObjectInputStream(f);
            RSAPrivateKey prk=(RSAPrivateKey)b.readObject( );
            //获取私钥的参数d,n
            BigInteger d=prk.getPrivateExponent();
            BigInteger n=prk.getModulus();
            //System.out.println("d= "+d);
            //System.out.println("n= "+n);
            //解密明文
            BigInteger m=c.modPow(d,n);
           // System.out.println("m= "+m);
            //计算明文对应的字符串并输出。
            byte[] mt=m.toByteArray();
            System.out.println("PlainText is ");
            for(int i=0;i<mt.length;i++){
                  System.out.print((char) mt[i]);
            }