Flubber Posted March 9, 2010 Report Posted March 9, 2010 (edited) # UPDATE [02.04.2010]:[*] Am corectat output-ul care il face Python in "cmd" din Windows cand se alege optiunea de output "Bytes" (nu am stiut cum sa o numesc altfel), cu ajutorul lui cmiN -- multumesc frumos.Pastebin url#!/usr/bin/env;# Coded by Flubber in Python 2.6.4;[b][color=red]# *Update: 02.04.2010 - thanks to cmiN: fixed the output script to "bytes", now the script is displaying the "correct" octates.[/b][/color]# Date: 09.03.2010; *02.04.2010# Strings to hashes. Encryption supported in: MD5; SHA1; SHA224; SHA256; SHA384; SHA512.print "\n[+] Starting up and configuring."print "[+] Importing modules."import timefrom time import strftimeimport hashlibprint "\n[+] Setting up 24h system clock."timea = strftime("%a, %d %b %Y @ %H:%M:%S")print "[+] " + timea + ":" + " All went OK. No errors."print "[+] " + timea + ":" + " Printing my awes0me banner."print ("""\n|==========================|| Today || I || Moo || || - "Moo!" ||==========================|\n\n""")print "[+] " + timea + ":" + " Starting up."time.sleep(2)print "[+] " + timea + ":" + " Printing your encrypting options..."option = raw_input("""Encrypting options:1: MD5;2: SHA1;3: SHA224;4: SHA256;5: SHA384;6: SHA512.If you want to exit press x or X and hit enter.If you want to encrypt, please choose one option of the above [1,2,3,4,5,6]: """)if option == '1': h = hashlib.md5()elif option == '2': h = hashlib.sha1()elif option == '3': h = hashlib.sha224()elif option == '4': h = hashlib.sha256()elif option == '5': h = hashlib.sha384()elif option == '6': h = hashlib.sha512()elif option == 'x' or option == 'X': print "\n\n[+] " + timea + ":" + " Exiting. Have a nice day." exit()else: print "\n[-] " + timea + ":" + " Oups, something went wrong." print "[-] " + timea + ":" + " Exiting. Sorry!" exit()print "\n[+] " + timea + ":" + " OK, you chose option number: " + option + "."hashy = raw_input("Enter your message to encrypt: ")h.update(hashy)print "\n\n[+] " + timea + ":" + " Encrypting, please wait..."print "[+] " + timea + ":" + " Done."print "[+] " + timea + ":" + " Printing your hash output options."digesto = raw_input("""\nPlease choose your hash output:1: "Bytes" (e.g. /x139/x26/x153/x83/x196/x97/x18/x150/x168/x39/x171/x248/x196/x120/x4/x215);2: Hex (e.g. 8b1a9953c4611296a827abf8c47804d7).Number: """)[b][color=red]bytes = "/x" + "/x".join([str(ord(x)) for x in h.digest()])[/b][/color]if digesto == '1': print "\n[+] " + timea + ":" + " Your hash is: " + bytes + " ." print "\n[+] " + timea + ":" + " Have a nice day!" exit()elif digesto == '2': print "\n[+] " + timea + ":" + " Your hash is: " + str(h.hexdigest()) + " ." print "\n[+] " + timea + ":" + " Have a nice day!" exit()else: print "\n[-] " + timea + ":" + " Oups! Something went wrong." print "[-] " + timea + ":" + " Exiting. Sorry!" exit()# OLDOK, sunt incepator (nici macar atat, dar intelegeti ideea), nu va asteptati la cine stie ce script:Pastebin url#!/usr/bin/env;# Coded by Flubber in Python 2.6;# Date: 09.03.2010;# Strings to hashes. Encryption supported in: MD5; SHA1; SHA224; SHA256; SHA384; SHA512.print "\n[+] Starting up and configuring."print "[+] Importing modules."import timefrom time import strftimeimport hashlibprint "\n[+] Setting up 24h system clock."timea = strftime("%a, %d %b %Y @ %H:%M:%S")print "[+] " + timea + ":" + " All went OK. No errors."print "[+] " + timea + ":" + " Printing my awes0me banner."print ("""\n|==========================|| Today || I || Moo || || - "Moo!" ||==========================|\n\n""")print "[+] " + timea + ":" + " Starting up."time.sleep(2)print "[+] " + timea + ":" + " Printing your encrypting options..."option = raw_input("""Encrypting options:1: MD5;2: SHA1;3: SHA224;4: SHA256;5: SHA384;6: SHA512.If you want to exit press x or X and hit enter.If you want to encrypt, please choose one option of the above [1,2,3,4,5,6]: """)if option == '1': h = hashlib.md5()elif option == '2': h = hashlib.sha1()elif option == '3': h = hashlib.sha224()elif option == '4': h = hashlib.sha256()elif option == '5': h = hashlib.sha384()elif option == '6': h = hashlib.sha512()elif option == 'x' or option == 'X': print "\n\n[+] " + timea + ":" + " Exiting. Have a nice day." exit()else: print "\n[-] " + timea + ":" + " Oups, something went wrong." print "[-] " + timea + ":" + " Exiting. Sorry!" exit()print "\n[+] " + timea + ":" + " OK, you chose option number: " + option + "."hashy = raw_input("Enter your message to encrypt: ")h.update(hashy)print "\n\n[+] " + timea + ":" + " Encrypting, please wait..."print "[+] " + timea + ":" + " Done."print "[+] " + timea + ":" + " Printing your hash output options."digesto = raw_input("""\nPlease choose your hash output:1: Bytes;2: Hex.Number: """)if digesto == '1': print "\n[+] " + timea + ":" + " Your hash is: " + str(h.digest()) + " ." print "\n[+] " + timea + ":" + " Have a nice day!" exit()elif digesto == '2': print "\n[+] " + timea + ":" + " Your hash is: " + str(h.hexdigest()) + " ." print "\n[+] " + timea + ":" + " Have a nice day!" exit()else: print "\n[-] " + timea + ":" + " Oups! Something went wrong." print "[-] " + timea + ":" + " Exiting. Sorry!" exit() Edited April 2, 2010 by Flubber New update. Quote
Flubber Posted March 10, 2010 Author Report Posted March 10, 2010 Bravo:) Iti place si tie Python?Yes Sir, dar sunt d-abia la inceput; usor usor ma fac eu mare cu Danonino Quote
Fitty Posted March 10, 2010 Report Posted March 10, 2010 E un inceput Cred ca o sa arunc si eu o privire peste Python asta...sau Perl... Quote