Skip to content

Instantly share code, notes, and snippets.

@seancallaway
Created February 4, 2016 17:18
Show Gist options
  • Select an option

  • Save seancallaway/ad967f324580141b098a to your computer and use it in GitHub Desktop.

Select an option

Save seancallaway/ad967f324580141b098a to your computer and use it in GitHub Desktop.
Converts a string into it's hexadecimal representation. Intended for BGP TCP MD5 passwords in BIRD on OpenBSD.
#!/usr/bin/env python
import sys, binascii
y = "your_password";
# If they didn't provide a password on the command-line, use the hard coded one.
if len(sys.argv) > 1:
y = str(sys.argv[1])
print "0x" + binascii.hexlify(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment