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与注册图解) 反编译神器 内含软件安装包.注册机及插件集合. 这里说下注册方法,注意不要在联网的情况下注册 ...
随机推荐
- caffe: train error: Serializing 25 layers--- Check failed: proto.SerializeToOstream(&output)
I0221 21:47:41.826748 6797 solver.cpp:259] Train net output #0: loss = 0.00413362 (* 1 = 0.0041 ...
- lua for循环
<转自网络,仅供学习> for循环是一个循环控制结构,可以有效地编写需要执行的特定次数的循环. 语法 Lua编程语言的for循环的语法是: for init,max/min value, ...
- unity3d用鼠标拖动物体的一段代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 这是一段拖动物体的代码,比较简洁明了,对了解uni ...
- maxscript,执行选中代码片段
选中一行或几行代码,然后按数字小键盘上的Enter键,即可单独运行之.此法方便调试.
- poj 1597 Uniform Generator【生成指定范围内所有随机数】
本文参考资料:http://hi.baidu.com/bnjyjncwbdbjnzr/item/1f997cfdd225d5d143c36a58 题意:一个生成随机数的函数, Seed[x+1] = ...
- Consul
1. 什么是consul? 是一个服务管理软件. 支持多数据中心下,分布式高可用的,服务发现和配置共享. consul支持健康检查,允许存储键值对. 一致性协议采用 Raft 算法,用来保证服务的高可 ...
- Tkinter颜色方案举例
效果图: 示例代码: # _*_ coding: utf-8 _*_ from Tkinter import * colors = '''#FFB6C1 LightPink 浅粉红 ,#FFC0CB ...
- css之cursor,float
鼠标形状: 在html中可以任意定义各个标签的显示形状,也可以此用来做些标签显示假像. <body> <p style="cursor: pointer"> ...
- html之dl标签
用来定义列表之用 通常与dt:定义列表中的项目 dd:描述列表中的项目 示例代码: <dl> <dt>数据库</dt> <dd>oracle</d ...
- String 深浅拷贝的测试---有待继续测试
public class TestString { void test1() { // TODO Auto-generated method stub String str = new String( ...