0

Possible Duplicate:
Reversing an MD5 Hash

I have a bit of code which I use to create a Guid from a String.

The code works fine but I now need to reverse the Guid it created and convert it back to the string.

Here is the code that I use to convert the String to Guid:

$s = strtoupper(md5($myString));
$guidText = 
substr($s,0,8) . '-' . 
substr($s,8,4) . '-' . 
substr($s,12,4). '-' . 
substr($s,16,4). '-' . 
substr($s,20); 

echo $guidText;

How can I reverse this code?

Community
  • 1
  • 1
Satch3000
  • 47,356
  • 86
  • 216
  • 346

3 Answers3

3

You can only reverse it back to MD5 hash. You can't really reverse MD5 hash back to it's original string.

Zbigniew
  • 27,184
  • 6
  • 59
  • 66
2

What you are looking for is encryption/decryption functions, not hash function(such as md5). Hash function are not reversable.

Engineer
  • 47,849
  • 12
  • 88
  • 91
1

md5() is a a hash function. Hash functions are not reversable

klaustopher
  • 6,702
  • 1
  • 22
  • 25