idea 注册机生成密钥代码
import java.math.BigInteger;
import java.util.Date;
import java.util.Random;
import java.util.zip.CRC32;
public class keygen {
/**
* @param s
* @param i
* @param bytes
* @return
*/
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();
}
/**
* @param biginteger
* @return String
*/
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();
}
/**
* @param i
* @return
*/
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();
}
/**
* @param name
* @param days
* @param id
* @param prtype
* @return
*/
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) {
if (args.length == 0) {
System.err.printf("*** Usage: %s name%n", keygen.class.getCanonicalName());
System.exit(1);
}
Random r = new Random();
System.out.println(MakeKey(args[0], 0, r.nextInt(100000)));
}
}
java keygen 用户名
idea 注册机生成密钥代码的更多相关文章
- C#软件授权、注册、加密、解密模块源码解析并制作注册机生成license
最近做了一个绿色免安装软件,领导临时要求加个注册机制,不能让现场工程师随意复制.事出突然,只能在现场开发(离开现场软件就不受我们控了).花了不到两个小时实现了简单的注册机制,稍作整理. ...
- 用C#.NET编写软件注册机
验证注册码是保护软件产品产权的常用手段.一般过程如下, 1. 软件发行者收集用户特有的信息: 2. 根据用户特有的信息,使用注册机生成注册码并把注册码发给客户: 3. 向软件导入注册码,由软件自 ...
- .NET Reflector 8.3.3.115 官方最新版+注册机(强大的.NET反编译工具破解版)
Lutz Roeder’s .NET Reflector,是一个可以将以.NET Framework为基础开发出来的的DLL或EXE文件,反编译为原始程序的工具软件..NET Reflector 工具 ...
- Navicat11全系列激活(注册机)
Navicat是一款数据库管理工具, 用于简化, 开发和管理MySQL, SQL Server, SQLite, Oracle 和 PostgreSQL 的数据库: Navicat数据模型工具以图形化 ...
- UltraEdit注册机 及使用方法详解
转载自:http://www.iyaxi.com/ultraedit-key/ UltraEdit是一款强大的文字编辑器,很多编程的.搞设计的等等都能用到它,具体功能请自行百度.今天为大家带来UE软件 ...
- Red-Gate.NET.Reflector.v8.0.1.308(内含注册机Keygen与注册图解)
Red-Gate.NET.Reflector.v8.0.1.308(内含注册机Keygen与注册图解) 反编译神器 内含软件安装包.注册机及插件集合. 这里说下注册方法,注意不要在联网的情况下注册 ...
- AUTO uninstaller 密钥/激活码/破解/注册机 ver 8.9.05 资源下载【转载】
技术贴:AUTO uninstaller 密钥/激活码/破解/注册机 ver 8.9.05 资源下载 楼主分享几个auto uninstaller密钥破解注册机,可以用于AUTO uninstalle ...
- IntelliJ IDEA 7.0 正式版注册机代码
好神奇,第一次看见注册机的源代码,自己运行一下.可以是java IDE环境,也可以是配置好jdk的dos环境. 然后输入自己的用户名就可以获得相对应的注册码,输入到软件中即可. 仅供参考,请购买正版. ...
- [转]Wing IDE 6.0 安装及算号器注册机代码
下载安装wing 选择第三个,运行算号器,输入license id 输入request id. Python 2 算号器注册机代码 import string import random import ...
随机推荐
- EasyuiAPI:布局
一.Panel(面板) 1.通过标签创建: <div id="p" class="easyui-panel" title="My Panel&q ...
- php 生成.txt文件
$content =array('color'=> array('blue','red','green'),'size'=> array('small','medium','large') ...
- Dot Product
These are vectors: They can be multiplied using the "Dot Product" (also see Cross Product) ...
- spring容器启动的加载过程(二)
第六步: public abstract class AbstractApplicationContext extends DefaultResourceLoader implements Confi ...
- Newtonsoft.Json使用
SkuBean sb = (SkuBean)Newtonsoft.Json.JsonConvert.DeserializeObject(jobj.ToString(), typeof(SkuBean) ...
- Python 的方法重载
为防止两个模块互相导入的问题,Python默认所有的模块都只导入一次,如果需要重新导入模块,Python2 7可以直接用reload(),Python3可以用下 为防止两个模块互相导入的问题,Pyth ...
- hibernate 配置文件
hibernate.cfg.xml </session-factory> //DAO类 package com.hanqi.dao; import org.hibernate.Sessio ...
- 可写的计算监控(Writable computed observables)
新手可忽略此小节,可写依赖监控属性真的是太advanced了,而且大部分情况下都用不到. 一般情况下,计算监控的值是通过其他监控属性的值计算出来的,因此它是只读的.这个看似很奇怪,我们有什么办法可以让 ...
- 关于css的hack问题
<!--[if <keywords>? IE <version>?]> HTML代码块 <![endif]--> 取值: <keywords> ...
- Access to the path "Library\UnityAssemblies\UnityEngine.xml" is denied.
这个问题基本上是重新打开UnityEditor,导入工程的时候VisualStudio还开着导致的. 解决方法是关掉Visual Studio,再重新打开.