What's new

[Python] MD5, Hex And Base64 Cracker Tool :)

  • Thread starter Sauce Code
  • Start date
  • Views 3,065
Sauce Code

Sauce Code

Banned.
Messages
804
Reaction score
177
Points
125
Sin$
7
Hia guys this is the first tool i made using python im still new to it so please dont hate :tongue:
it can decrypt MD5, Hex And Base64 :smile:

Code:
# Welcome to Sauce Code's You can encrypt/decrypt: Hexadecimal, MD5 and Base64.
# This program was created for educational purposes only. I (author) am not responsible for misuse.
# Written on 8/02/13 
# Debugged on 9/02/13
import hashlib, urllib2 , urllib, sys
def start():
 print '-' * 40
 print "Welcome to Sauce Code's Cracker Tool"
 print '-' * 40
 print "Would you like to:"
 print "\t1. Work with Hexadecimal."
 print "\t2. Work with MD5."
 print "\t3. Work with Base64.\n"
 choice = raw_input("> ")
 if choice == "1":
  hex()
 elif choice == "2":
  md5Hash()
 elif choice == "3":
  base64()
 else:
  print "Enter 1, 2 or 3, idiot."
  start() 
def hex():
 print "Hexadecimal to string (1) or string to hexadecimal (2)?"
 i = raw_input("> ")
 if i == "1":
  toStr = raw_input("Enter hex string: ").decode("hex")
  print "Ascii string = %s" % toStr
  finish()
 elif i == "2":
  toHex = raw_input("Enter string: ").encode("hex")
  print "Hexadecimal string = %s" % toHex
  finish()
 else:
  print "Enter 1 or 2, idiot."
  hexConverter() 
def md5Hash():
 print "String to MD5 (1) or MD5 to String (2)?"
 print "*You may need to allow a firewall exception when prompt*"
 i = raw_input("> ")
 if i == "1":
  toStr = hashlib.md5(raw_input("Enter string: ")).hexdigest()
  print "MD5 hash = %s" % toStr
  finish()
 elif i == "2":
  url = "[url]http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php[/url]"
  md5 = str(raw_input("Enter MD5 hash: "))
  data = {'md5': md5}
  data = urllib.urlencode(data)
  req = urllib2.Request(url, data)
  response = urllib2.urlopen(req)
  oldStr = response.readlines()[161]    # Line in html where response is
  newStr = oldStr.replace("</div>", " ")   # Chopping up line 
  hash = newStr[77:]       # Chop it more
  if hash == "":
   print "Sorry, no matches in database."
   finish()
  else:
   print "Ascii string = %s" % hash
   finish()
 else:
  print "Enter 1 or 2, idiot."
  md5Hash()
def base64():
 print "Base64 to string (1) or string to Base64 (2)?"
 i = raw_input("> ")
 if i == "1":
  toStr = raw_input("Enter Base64 string: ").decode("base64")
  print "Ascii string = %s" % toStr
  finish()
 elif i == "2":
  toB64 = raw_input("Enter Ascii string: ").encode("base64")
  print "Base64 string = %s" % toB64
  finish()
 else:
  print "Enter 1 or 2, idiot."
  base64() 
def finish():
 print "\nType 'restart' to restart program or 'quit' to exit."
 e = raw_input("> ")
 if e == "restart":
  start()
 elif e == "quit":
  exit(0)
 else:
  finish()
  
start() # Let it begin...
 
Z61

Z61

Some times our saints are sinners
Retired
Programmer Forum Addict Odysseus' Summit
Messages
5,468
Reaction score
3,429
Points
1,042
Sin$
0
Please format your code using
Code:
[code]
tags.
 
Liquid44

Liquid44

Banned
Programmer
Messages
1,158
Reaction score
691
Points
245
Sin$
0
You can't decrypt a MD5 hash, is a one-way algorithm; You can use collisions but that is completely different.

What lol collision means two different pieces of data will have the same hash. So how would that allow you to get the original data? I think you mean using a rainbow table.
 
Visual Studio

Visual Studio

The Original Shiba Inu
Odysseus' Summit Nevar gon' happen in your lifetime Programmer
Messages
2,748
Reaction score
1,488
Points
1,162
Sin$
7
What lol collision means two different pieces of data will have the same hash. So how would that allow you to get the original data? I think you mean using a rainbow table.
Collisions are when you get the same hashes twice. A successful brute force or rainbow table gives you a collision with the original and generated hashes.
 
Liquid44

Liquid44

Banned
Programmer
Messages
1,158
Reaction score
691
Points
245
Sin$
0
Collisions are when you get the same hashes twice. A successful brute force or rainbow table gives you a collision with the original and generated hashes.

So if you hash some data and then hash it again without changing anything it will obviously give the same hash lol

It has to be different data to give the same hash and a collision occurs.
 
Visual Studio

Visual Studio

The Original Shiba Inu
Odysseus' Summit Nevar gon' happen in your lifetime Programmer
Messages
2,748
Reaction score
1,488
Points
1,162
Sin$
7
So if you hash some data and then hash it again without changing anything it will obviously give the same hash lol

It has to be different data to give the same hash and a collision occurs.
EDIT: Scratch that I was misinformed on what a hash collision was. I am talking about rainbow tables.
 
Top Bottom
Login
Register