fork(28) download
  1. from hashlib import md5
  2.  
  3. my_bssid = '11:22:33:44:55:66'
  4.  
  5. def gen_key_evg1500(bssid):
  6. bssid = ''.join(filter(lambda x: x in '0123456789abcdefABCDEF', bssid))
  7. if len(bssid) != 12:
  8. raise ValueError('ERROR: MAC address must be in the form of 12 hexdigits, '
  9. 'perhaps with some delimiters (e.g. 01:23:45:67:89:AB)')
  10. bssid = (':'.join([bssid[i:i+2] for i in range(0,12,2)])).upper()
  11.  
  12. bssid_hash = md5(bssid.encode('ASCII') + b'\n').hexdigest()
  13. key = ''.join(filter(lambda x: x not in '01', bssid_hash))[:10]
  14. ssid = ''.join(filter(lambda x: x.isdigit(), bssid_hash))[:4]
  15. return {'bssid': bssid, 'ssid': 'WiFi-DOM.ru-' + ssid, 'key': key}
  16.  
  17. print(gen_key_evg1500(my_bssid))
Success #stdin #stdout 0.03s 11352KB
stdin
Standard input is empty
stdout
{'bssid': '11:22:33:44:55:66', 'ssid': 'WiFi-DOM.ru-7741', 'key': '774dfbf835'}