Idea KeyGen
import java.math.BigInteger;
import java.util.Date;
import java.util.Random;
import java.util.Scanner;
import java.util.zip.CRC32;
public class KeyGen {
public static short getCRC(String s, int i, byte bytes[]){
CRC32 crc32 = new CRC32();
if (s != null)
{
for (int j = 0; j < s.length(); j++)
{
char c = s.charAt(j);
crc32.update(c);
}
}
crc32.update(i);
crc32.update(i >> 8);
crc32.update(i >> 16);
crc32.update(i >> 24);
for (int k = 0; k < bytes.length - 2; k++)
{
byte byte0 = bytes[k];
crc32.update(byte0);
}
return (short) (int) crc32.getValue();
} public static String encodeGroups(BigInteger biginteger){
BigInteger beginner1 = BigInteger.valueOf(0x39aa400L);
StringBuilder sb = new StringBuilder();
for (int i = 0; biginteger.compareTo(BigInteger.ZERO) != 0; i++)
{
int j = biginteger.mod(beginner1).intValue();
String s1 = encodeGroup(j);
if (i > 0)
{
sb.append("-");
}
sb.append(s1);
biginteger = biginteger.divide(beginner1);
}
return sb.toString();
} public static String encodeGroup(int i){
StringBuilder sb = new StringBuilder();
for (int j = 0; j < 5; j++)
{
int k = i % 36;
char c;
if (k < 10)
{
c = (char) (48 + k);
}
else
{
c = (char) ((65 + k) - 10);
}
sb.append(c);
i /= 36;
}
return sb.toString();
} public static String MakeKey(String name, int days, int id){
id %= 100000;
byte bkey[] = new byte[12];
bkey[0] = (byte) 1; // Product type: IntelliJ IDEA is 1
bkey[1] = 14; // version
Date d = new Date();
long ld = (d.getTime() >> 16);
bkey[2] = (byte) (ld & 255);
bkey[3] = (byte) ((ld >> 8) & 255);
bkey[4] = (byte) ((ld >> 16) & 255);
bkey[5] = (byte) ((ld >> 24) & 255);
days &= 0xffff;
bkey[6] = (byte) (days & 255);
bkey[7] = (byte) ((days >> 8) & 255);
bkey[8] = 105;
bkey[9] = -59;
bkey[10] = 0;
bkey[11] = 0;
int w = getCRC(name, id % 100000, bkey);
bkey[10] = (byte) (w & 255);
bkey[11] = (byte) ((w >> 8) & 255);
BigInteger pow = new BigInteger("89126272330128007543578052027888001981", 10);
BigInteger mod = new BigInteger("86f71688cdd2612ca117d1f54bdae029", 16);
BigInteger k0 = new BigInteger(bkey);
BigInteger k1 = k0.modPow(pow, mod);
String s0 = Integer.toString(id);
String sz = "0";
while (s0.length() != 5)
{
s0 = sz.concat(s0);
}
s0 = s0.concat("-");
String s1 = encodeGroups(k1);
s0 = s0.concat(s1);
return s0;
} public static void main(String[] args){
System.out.println("请输入用户名:");
Scanner scanner = new Scanner(System.in);
String username = scanner.next();
Random r = new Random();
System.out.println(MakeKey(username, 0, r.nextInt(100000)));
}
}
Idea KeyGen的更多相关文章
- JetBrains.DotMemory.Keygen.4.x
GoogleN久都没找到这一类的工具. 只好折腾一个了. CSDN 免积分 0积分 下载 http://download.csdn.net/detail/caizz520/7477865 全球首发-V ...
- [Keygen]IntelliJ IDEA 14.1.7
IntelliJ IDEA 14.1.7 Keygen package com.candy.keygen.intelliJIdea; import java.math.BigInteger; impo ...
- LLBLGen Pro v4.2_Patch+Keygen
将dll文件覆盖安装目录下的文件,之后用算号器算出license文件,将license文件放在安装目录下即可. 算号器是在http://www.dxper.net/thread-408-1-1.htm ...
- IntelliJ IDEA 13 Keygen
import java.math.BigInteger; import java.util.Date; import java.util.Random; import java.util.zip.CR ...
- 新增的output元素 progress元素 meter元素 keygen元素
结果图 <output>是双标签 name:定义对象的唯一属性 for:定义输出域相关的一个或多个元素. form:定义所属的一个至多个表单. progress和meter一般和JS一起使 ...
- Adobe Acrobat XI Pro 两种破解方式 Keygen秘钥 license替换 亲测有效
大家平时看paper比较多的话想必都是用Adobe Acrobat而非Adobe Reader吧,其功能全面之处就不啰嗦了,下面给大家分享下Adobe Acrobat XI Pro的两种破解方式(两种 ...
- Centos6架设GIT服务,windows客户端使用TortoiseGit加载KEYGEN连接GIT服务器
前几天得空,想起前一阵学了GIT还没好好实践,就在虚拟机中安装测试了一下,并简单记录了CENTOS6中GIT安装,ssh-keygen生成,客户端使用TortoiseGit加载KEYGEN连接GIT服 ...
- IDEA12 KeyGen Download List
When you use IDEA to develop Java, you can use the following file to generate lincese. Because CNBlo ...
- Red-Gate.NET.Reflector.v8.0.1.308(内含注册机Keygen与注册图解)
Red-Gate.NET.Reflector.v8.0.1.308(内含注册机Keygen与注册图解) 反编译神器 内含软件安装包.注册机及插件集合. 这里说下注册方法,注意不要在联网的情况下注册 ...
随机推荐
- IE6 7 8BUG锦集
1.浮动元素的双倍margin 说明:这是IE6及其以下版本的一个经典的BUG,触发这个BUG产生的条件是给元素设置了浮动并且同一方向设置了margin值.来看以下代码: <style type ...
- Java Memory Model
http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html http://www.ibm.com/developerworks/libr ...
- 基于theano的深度卷积神经网络
使用了两个卷积层.一个全连接层和一个softmax分类器. 在测试数据集上正确率可以达到99.22%. 代码参考了neural-networks-and-deep-learning #coding:u ...
- XML 命名空间(XML Namespaces)
XML 应用程序 XML CDATA XML 命名空间提供避免元素命名冲突的方法. 命名冲突 在 XML 中,元素名称是由开发者定义的,当两个不同的文档使用相同的元素名时,就会发生命名冲突. 这个 X ...
- shell之echo与printf和颜色
在用户的bashrc中添加一行export来修改提示符.
- 【转】用ASP.NET加密Cookie数据
来源:http://www.cnblogs.com/taizhouxiaoba/archive/2009/02/05/1384772.html Cookie中的数据以文本的形式存在客户端计算机,考虑它 ...
- 分巧克力【来源:CSDN线上编程挑战赛】——递归,费波那奇数列,迭代
/*====================================================================== 儿童节快到了,班长想要给班上的每个同学给一个巧克力, ...
- android数据存储之File
android中使用File进行存储主要使用到OpenFileOutput和OpenFileInput两个方法,下面直接用一个例子来说明一下. (1)布局文件main.xml文件 <?xml v ...
- jQuery Mobile_页面事件
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- 数据结构线性表(js实现)
最近在复习数据结构的过程中,发现基本上数据结构都是用C来实现的,自己之前学习的时候也是用C去写的,由于目前对js更为熟悉一些,所以这里选择使用js去实现其中的某些算法和结构.实际上算法和语言关系不大, ...