-2

I have this hash generated with crypt function in php: $1$jV3.NS/.$JLVMBWe0N/W0Rbft4NgPV.

I know $1$ is MD5's hash, jV3.NS/. is the salt and the other text is the encrypted string. Is possible decrypt this hash if I know the salt?

gen_Eric
  • 223,194
  • 41
  • 299
  • 337
fdisotto
  • 95
  • 2
  • 7
  • 4
    it's a hash, not an encryption; once you get the value you can't revert it; you can only try to find one of the possible inputs that generated the outputs using huge databases – mishu Mar 12 '12 at 15:06
  • Please remember to upvote any answers that helped, and accept the best one. – Jonathon Reinhart Jun 28 '12 at 04:57

4 Answers4

13

No. That's the point of a cryptographic hash. It's easy to compute but computationally infeasible to invert.

Celada
  • 21,627
  • 4
  • 64
  • 78
  • 2
    +1 for using the words computationally infeasible – Jasper De Bruijn Mar 12 '12 at 15:26
  • 1
    Yeah. Also, sausage UNgrinders can be shown to be computationally infeasible. The proof will be published in a forthcoming article in a peer-reviewed journal. It contains a very interesting corner case which occurs only with merguez sausages. – Celada Mar 12 '12 at 15:32
11

No. That is the primary purpose for a hash. It is a one way mathematical operation.

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
8

A hash is a function designed to be easy to run forward, but exceedingly expensive/painful to reverse. Think of it like a sausage grinder. You can put practically anything you want in going forward but it's near impossible to turn the grinder backwards and get the original components back out

Hasteur
  • 462
  • 2
  • 6
  • 1
    +1 for sausage grinder analogy. – gen_Eric Mar 12 '12 at 15:08
  • +1 - though a sausage grinder still produces all of its inputs as output - so it's more of a one-time pad which doesn't preserve its encryption key :) My favourite is say "I'm thinking of two 4-digit numbers. If I multiply them, the final two digits are 12. What two numbers am I thinking of?" – Paul Dixon Mar 12 '12 at 15:14
  • @PaulDixon I wasn't going for a 100% accurate analogy, more one that shows the level of challenge that would be required in order to piece the parts back together once the "machine" has been run. – Hasteur Mar 12 '12 at 15:18
0

No, MD5 and other hashing functions are considered to be one way algorithms to prevent people from doing exactly what you're looking to do. However it IS possible to do a look-up against a library of precompiled words/passwords/etc. And find a match. (commonly called a rainbow table attack).

However the addition of a salt value means you will most likely have to brute force it, which will take a while. Though if you have the setup, there are some GPU accelerated programs that are REALLY fast.

This should get you started. OphCrack: http://ophcrack.sourceforge.net/

cDecker32
  • 813
  • 1
  • 10
  • 20