| 0. 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. 29. 30. 31. 32. 33. 34. 35. 36. 37. | #!/usr/bin/python #Generates a wep key from pass phrase or password. #d3hydr8[at]gmail[dot]com #http://darkcode.ath.cx import sys, binascii, re if len(sys.argv) != 2: print "Usage: ./wepgen.py <pass phrase>" sys.exit(1) key = binascii.b2a_hex(sys.argv[1]) finalkey = "" set = re.findall("\w\w\w\w", key) num = 0 while len(set) != num: if num == 0: finalkey = finalkey + set[num] key = key.replace(set[num],"") else: finalkey = finalkey + "-"+set[num] key = key.replace(set[num],"") num +=1 finalkey = finalkey + "-"+key print "\nWEP key:",finalkey,"\n" |