Differences between revisions 3 and 4
Revision 3 as of 2008-11-15 14:00:04
Size: 942
Editor: localhost
Comment: converted to 1.6 markup
Revision 4 as of 2009-12-27 05:20:12
Size: 952
Editor: adsl-71-141-121-43
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
{{{ #!/usr/bin/bash {{{
#!/usr/bin/bash
Line 9: Line 10:
import md5 import hashlib
Line 14: Line 15:
    hash = md5.new( salt + textstr ).hexdigest()     hash = hashlib.md5( salt + textstr ).hexdigest()
Line 41: Line 42:
root.mainloop() }}} root.mainloop()
}}}

Description

Create an MD5 Hash with this little script that comes with a simple TKinter GUI. Get more info on creating MD5 hashes at Md5Passwords

Code

from Tkinter import *
import hashlib

def doitnow():
    salt = insalt.get()
    textstr = text_str.get()
    hash = hashlib.md5( salt + textstr ).hexdigest()
    hashtext.delete(0,END)
    hashtext.insert(0,hash)
    return 0

root = Tk()
lab1 = Label(root, text = 'Salt:')
lab2 = Label(root, text = 'Key String:')
lab3 = Label(root, text = 'Hash:')

insalt = Entry(root, bg = 'white')
text_str= Entry(root, bg = 'white')
hashtext = Entry(root, bg = 'white')

button = Button(root,text = "Hash It", command = doitnow)

insalt.focus()

lab1.pack(anchor = W)
insalt.pack(anchor = W)
lab2.pack(anchor = W)
text_str.pack(anchor = W)
lab3.pack(anchor = W)
hashtext.pack(anchor = W)
button.pack(ancho = E)


root.mainloop()

tk md5 (last edited 2009-12-27 05:20:12 by adsl-71-141-121-43)

Unable to edit the page? See the FrontPage for instructions.