Created
May 13, 2014 08:52
-
-
Save fumiyas/9b3a927b8c0e2c2332ae to your computer and use it in GitHub Desktop.
Generate Windows NT password hash
This file contains 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/python | |
import sys | |
import getpass | |
import hashlib | |
import binascii | |
if sys.stdin.isatty(): | |
p = getpass.getpass() | |
else: | |
p = sys.stdin.readline().rstrip("\n") | |
hash = hashlib.new('md4', p.encode('utf-16le')).digest() | |
print binascii.hexlify(hash).upper() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment