Current location: Hot Scripts Forums » Programming Languages » PHP » md5 decode/encode


md5 decode/encode

Reply
  #1 (permalink)  
Old 06-28-07, 07:21 AM
zodehala zodehala is offline
Wannabe Coder
 
Join Date: Mar 2007
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
md5 decode/encode

PHP Code:

echo md5("zodehala"); //   = d6734f72e17eefa8abd6d2d43a81924b 

how can i encode "d6734f72e17eefa8abd6d2d43a81924b" ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-28-07, 07:25 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
encode? why would you want to encode an md5?

If you mean decode: you can't. md5 is not, as many people think, an encoding, but a hash. A hash is a one-way encoding: you can only encrypt the entered text, but never decrypt.
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-28-07, 07:51 AM
zodehala zodehala is offline
Wannabe Coder
 
Join Date: Mar 2007
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-28-07, 08:07 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by zodehala View Post

thats nothing more then a database of known matches.

Everything i encrypted it was able to decrypt correctly, when i gave it a md5 of my favorite password it returned "Sorry, we could not find a matching decryption."

MD5 and SHA1 are both, as UnrealEd already said, inpossible to decode
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 06-30-07, 02:58 AM
fyrestrtr fyrestrtr is offline
Wannabe Coder
 
Join Date: Nov 2003
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
They are not impossible to decode, but md5 has a collision which makes it less secure.

Although, for all practical purposes -- if you are running an application that people will try to hack (and spend the time and effort to find a powerful enough computer to find a collision) then you really shouldn't be using md5 in the first place

As mentioned about, md5 is not an encryption algorithm, it is a one-way hash. What this means is, md5 is a mechanism that when fed the same plain text, it will always generate the same cryptext (a collision, in plain terms, happens when two different plain texts generate the same cryptext).

To verify two unknowns, you run then through the md5 and check the cryptext. If it is the same, you know the plain text was the same.

You cannot get the plain text from the cryptext (that is why it is called one-way).

If you want two-way, then use a proper encryption algorigthm.
__________________
Find me at WHT
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 06-30-07, 05:46 PM
lylesback2 lylesback2 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
try this, when selecting the MD5 from the database

PHP Code:

WHERE username='$username' AND password=MD5('$password'
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 07-01-07, 06:06 AM
dotti dotti is offline
New Member
 
Join Date: Jul 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Why make your own decoder...
Use someone elses on the web.
But if your trying to take from a database use lylesback2's little code.
Or you could make a script that generates matches of md5 hases and plain text
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 07-04-07, 03:56 AM
zodehala zodehala is offline
Wannabe Coder
 
Join Date: Mar 2007
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
not for db

just to know

i want to know how to MD5 decrypt ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 07-04-07, 04:05 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
As everyone in this thread stated already, you can not decrypt MD5. It's not possible.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 02-17-09, 12:00 PM
benjamin247 benjamin247 is offline
New Member
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Hash vs Encode

As stated by several people here, md5 is a hashing method and not an encoding method. Hashes are one-way whereas encoding is two ways.

Hypothetical Simple 2-way Encoding:
Method: Switch a with b, b with c,.... and switch z and a.
Result: "the quick brown fox" becomes "tif rvjdl cspxo gpy"
Decoding: Simply run the reverse function (a->z, b->a, c->b, etc).

Hypothetical Simple 1-Way Hash
Method: switch letters with numbers and multiply each letter in a word together. Then push the number-strings together and remove the zeros.
Result: "the quick brown fox" becomes:
-> (20x8x5) (17x21x9x3x11) (2x18x15x23x14) (6x15x24)
(combine strings)-> 8001060291738802160
(remove zeros) -> 8162917388216
Decoding: Data has been lost and is scrambled (precluding recovers) and there may be multiple strings that result in a 8162917388216 outcome. if I type in "the quick brown fox" it will always hash to 8162917388216 (so it's good to verify if someone has typed in a correct password) but you cannot reconstruct the string from the hash.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MD5 and importing data into new DB ELV1I2 Database 2 06-14-07 03:12 PM
MD5 password for registered users zoliky PHP 7 11-04-06 10:06 AM
Forgot Password MD5 adubb PHP 7 07-14-06 07:54 PM
md5 issue tophat PHP 8 06-30-06 10:08 AM
Mysql and MD5 nicpon PHP 4 04-23-04 09:58 PM


All times are GMT -5. The time now is 08:09 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.