Created
February 4, 2016 17:18
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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