For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
import hashlib | |
import hmac | |
import struct | |
def dt(mac): | |
hdig = mac.hexdigest() | |
offset = int(hdig[-1], 16) | |
p = hdig[offset * 2 : offset * 2 + 8] | |
return int(p, 16) & 0x7fffffff |
.gist-highlight { | |
border-left: 3ex solid #eee; | |
position: relative; | |
} | |
.gist-highlight pre { | |
counter-reset: linenumbers; | |
} | |
.gist-highlight pre div:before { |