-1

Is there any function in php which allows me to de-hashing a string?

For example:

$hashedInfo = hash('md5', 'Hello World!');

I want to do the inverse thing, something like:

$deashedInfo = dehash('md5', $hashedInfo);

Thank you!

user3563844
  • 113
  • 1
  • 8
  • 3
    md5 is one way hash i think, and NO but you can use any other crypto functions – daremachine Jul 13 '18 at 07:03
  • 2
    Possible duplicate of [PHP dehashing the password](https://stackoverflow.com/questions/3615408/php-dehashing-the-password) – david Jul 13 '18 at 07:05
  • Possible duplicate of [Fundamental difference between Hashing and Encryption algorithms](https://stackoverflow.com/questions/4948322/fundamental-difference-between-hashing-and-encryption-algorithms) – user3942918 Jul 13 '18 at 08:12

1 Answers1

4

It's not possible, because md5 function is not bijective. 2 different inputs can result in same hash value.

mihai1990
  • 632
  • 5
  • 20
  • 1
    However, since MD5 is widely used, the value can be reverse-engineered in seconds via Rainbow Table. Google it. Keep in mind that MD5 is not safe. – Raptor Jul 13 '18 at 08:50
  • 2
    @Raptor If I have a document that's 5 MB in size, that Rainbow Table de-hashing scheme is not going to reverse engineer it in any short amount of time. Rainbow Table is fine for cracking relatively short strings like passwords, but it's not a generalized "create text from hash" function. – Jim Mischel Jul 13 '18 at 15:15