Skip to Main Content
March 21, 2010

Generate an NTLM hash in 3 lines of Python...

Written by David Kennedy
Penetration Testing Security Testing & Analysis
Needed to generate a quick NTLM hash for integration within PyCUDA for a GPU based cracker. While combing through the RFC and found that writing this was extremely easy. Anyways here's a quick example on creating an NTLM hash with 3 lines of Python. import hashlib,binascii hash ='md4', "thisismyhashvalue".encode('utf-16le')).digest() print binascii.hexlify(hash)