fork download
  1. import java.io.PrintStream;
  2. import java.math.BigInteger;
  3. import java.util.Date;
  4. import java.util.Random;
  5. import java.util.Scanner;
  6. import java.util.zip.CRC32;
  7.  
  8. public class Main {
  9.  
  10. public static final byte PRODUCT_TYPE = 1; //IntelliJ IDEA
  11. public static final byte PRODUCT_VERSION = 14;
  12. public static final String DEFUALT_NAME = "IntelliJ IDEA";
  13.  
  14. public static final Random rnd = new Random();
  15. public static final char[] encodeTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
  16.  
  17. public static final BigInteger pow = new BigInteger("89126272330128007543578052027888001981", 10);
  18. public static final BigInteger mod = new BigInteger("86f71688cdd2612ca117d1f54bdae029", 16);
  19.  
  20. public static final BigInteger baseChunk = BigInteger.valueOf(0x39aa400L);
  21. public static final int baseDigit = encodeTable.length;
  22.  
  23. public static final Scanner in = new Scanner(System.in);
  24. public static final PrintStream out = System.out;
  25.  
  26. public static byte[] writeSignature(char[] name, int salt, byte[] bkey) {
  27. CRC32 crc32 = new CRC32();
  28.  
  29. for (char chr : name) {
  30. crc32.update(chr);
  31. }
  32.  
  33. crc32.update(salt);
  34. crc32.update(salt >> 8);
  35. crc32.update(salt >> 16);
  36. crc32.update(salt >> 24);
  37.  
  38. for (int i = 0; i < bkey.length - 2; i++) {
  39. crc32.update(bkey[i]);
  40. }
  41.  
  42. short sign = (short) crc32.getValue();
  43.  
  44. bkey[10] = (byte) (sign & 255);
  45. bkey[11] = (byte) ((sign >> 8) & 255);
  46.  
  47. return bkey;
  48. }
  49.  
  50.  
  51. public static String keyToString(BigInteger key) {
  52. StringBuilder builder = new StringBuilder();
  53.  
  54. for (int i = 0; key.compareTo(BigInteger.ZERO) != 0; i++) {
  55. if (i > 0) {
  56. builder.append("-");
  57. }
  58.  
  59. int num = key.mod(baseChunk).intValue();
  60.  
  61. for (int j = 0; j < 5; j++, num /= baseDigit) {
  62. builder.append(encodeTable[num % baseDigit]);
  63. }
  64.  
  65. key = key.divide(baseChunk);
  66. }
  67.  
  68. return builder.toString();
  69. }
  70.  
  71.  
  72. public static String generateKey(String name, int days) {
  73. int salt = rnd.nextInt(100000);
  74. int ld = (int) (new Date().getTime() >> 16);
  75.  
  76. salt %= 100000;
  77. days &= 0xffff;
  78.  
  79. byte[] bkey = { //size 12
  80. PRODUCT_TYPE,
  81. PRODUCT_VERSION,
  82.  
  83. (byte) (ld & 0xff),
  84. (byte) ((ld >> 8) & 0xff),
  85. (byte) ((ld >> 16) & 0xff),
  86. (byte) ((ld >> 24) & 0xff),
  87.  
  88. (byte) (days & 0xff),
  89. (byte) ((days >> 8) & 0xff),
  90.  
  91. 105, -59, 0, 0
  92. };
  93.  
  94. bkey = writeSignature(name.toCharArray(), salt, bkey);
  95.  
  96. BigInteger key = new BigInteger(bkey);
  97. key = key.modPow(pow, mod);
  98.  
  99. return String.format(
  100. "%05d-%s",
  101. salt,
  102. keyToString(key)
  103. );
  104. }
  105.  
  106.  
  107. public static void main(String[] args) {
  108. out.printf("\nJetBrains IntelliJ IDEA Keygen\nEnter name [%s]: ", DEFUALT_NAME);
  109. String userName = in.nextLine().trim();
  110.  
  111. if (userName.isEmpty()) {
  112. userName = DEFUALT_NAME;
  113. }
  114.  
  115. out.printf("\nName: %s\nKey: %s\n", userName, generateKey(userName, 0));
  116.  
  117. out.println("Press Enter to exit...");
  118. in.hasNextLine();
  119. }
  120.  
  121. }
Success #stdin #stdout 0.12s 57060KB
stdin
fwp
stdout
JetBrains IntelliJ IDEA Keygen
Enter name [IntelliJ IDEA]: 
Name: fwp
Key:  25718-YCOE6-USR1M-8IGGH-PC00D-B7K12
Press Enter to exit...