Skip to content

Instantly share code, notes, and snippets.

@diabloneo
Created September 2, 2013 11:35
Show Gist options
  • Save diabloneo/6411942 to your computer and use it in GitHub Desktop.
Save diabloneo/6411942 to your computer and use it in GitHub Desktop.
Calculate RADIUS packet authenticator. Input packet's hex string, output authenticator in hex form.
#!/usr/bin/env python
import hashlib
import base64
import binascii
def main():
pktstr = raw_input()
m = hashlib.md5()
m.update(base64.b16decode(pktstr.replace(' ', '').upper()))
authenticator = binascii.b2a_hex(m.digest())
print "authenticator:"
print "%s" % (authenticator)
if __name__ == "__main__":
main()
@zfw
Copy link

zfw commented Sep 3, 2013

nice job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment