Created
May 7, 2010 22:45
-
-
Save gerry/394104 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calculate the lower 6 bytes of the WEP key, the upper 4 are from the MAC | |
# address of the router (1801 or 1F90) | |
def get_key(essid): | |
key = sum(int(val, 36) * (36**idx) for idx, val in enumerate(essid)) | |
return hex(key) | |
# >>> print get_key("E3X12") | |
# 0x349fca | |
# or as a one liner: | |
print hex(sum(int(val, 36) * (36**idx) for idx, val in enumerate(essid))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment