-2

What is the decrypt function for crypt function in PHP

Thanks Bharanikumar

Bharanikumar
  • 24,893
  • 50
  • 129
  • 194

3 Answers3

5

From the PHP Manual

There is no decrypt function, since crypt() uses a one-way algorithm.

Eborbob
  • 1,794
  • 1
  • 13
  • 30
Atif
  • 10,395
  • 19
  • 62
  • 95
4

5 seconds of searching stackoverflow:

I'm sure google has more. Please do a bit of research before you ask a question, it's not fair to just expect everyone else to do all the thinking for you.

Community
  • 1
  • 1
Jeriko
  • 6,429
  • 4
  • 27
  • 40
2

You cannot decrypt the crypt function but if you need original string back, use mcrypt_encrypt and mcrypt_decrypt, and choose key based encryption like MCRYPT_RIJNDAEL_256

YOU
  • 114,140
  • 31
  • 183
  • 213