Skip to content

Instantly share code, notes, and snippets.

@gerry gerry/

Created May 7, 2010
What would you like to do?
# 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
You can’t perform that action at this time.