easybox keygen - Java Source


SUBMITTED BY: Guest

DATE: Dec. 3, 2013, 1:24 p.m.

FORMAT: Java

SIZE: 2.2 kB

HITS: 970

  1. public class EasyBoxWPAGen {
  2. public static String GENERATE_WPA_KEY (String mac){
  3. String wpaKey = "";
  4. mac = mac.trim();
  5. mac = mac.replace(":", "");
  6. mac = mac.replace(" ", "");
  7. if (mac.length() == 12){
  8. String C1 = ""+ Integer.parseInt(mac.substring(8), 16);
  9. while (C1.length() < 5) C1 = 0+C1;
  10. char S6 = C1.charAt(0);
  11. char S7 = C1.charAt(1);
  12. char S8 = C1.charAt(2);
  13. char S9 = C1.charAt(3);
  14. char S10 = C1.charAt(4);
  15. char M7 = mac.charAt(6);
  16. char M8 = mac.charAt(7);
  17. char M9 = mac.charAt(8);
  18. char M10 = mac.charAt(9);
  19. char M11 = mac.charAt(10);
  20. char M12 = mac.charAt(11);
  21. String tmpK1 = Integer.toHexString(Character.digit(S7, 16) + Character.digit(S8, 16) + Character.digit(M11, 16) + Character.digit(M12, 16));
  22. String tmpK2 = Integer.toHexString(Character.digit(M9, 16) + Character.digit(M10, 16) + Character.digit(S9, 16) + Character.digit(S10, 16));
  23. char K1 = tmpK1.charAt(tmpK1.length() -1);
  24. char K2 = tmpK2.charAt(tmpK2.length() -1);
  25. String X1 = Integer.toHexString(Character.digit(K1, 16) ^ Character.digit(S10, 16));
  26. String X2 = Integer.toHexString(Character.digit(K1, 16) ^ Character.digit(S9, 16));
  27. String X3 = Integer.toHexString(Character.digit(K1, 16) ^ Character.digit(S8, 16));
  28. String Y1 = Integer.toHexString(Character.digit(K2, 16) ^ Character.digit(M10, 16));
  29. String Y2 = Integer.toHexString(Character.digit(K2, 16) ^ Character.digit(M11, 16));
  30. String Y3 = Integer.toHexString(Character.digit(K2, 16) ^ Character.digit(M12, 16));
  31. String Z1 = Integer.toHexString(Character.digit(M11, 16) ^ Character.digit(S10, 16));
  32. String Z2 = Integer.toHexString(Character.digit(M12, 16) ^ Character.digit(S9, 16));
  33. String Z3 = Integer.toHexString(Character.digit(K1, 16) ^ Character.digit(K2, 16));
  34. wpaKey = X1+Y1+Z1+X2+Y2+Z2+X3+Y3+Z3;
  35. System.out.println("WPA-KEY: "+ wpaKey);
  36. } else {
  37. System.out.println("Error: MAC-Address must have 12 digits!");
  38. }
  39. return wpaKey;
  40. }
  41. }

comments powered by Disqus