-2

What is the decrypt function for crypt function in PHP

Thanks Bharanikumar

Bharanikumar
  • 25,457
  • 50
  • 131
  • 201

3 Answers3

5

From the PHP Manual

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

Eborbob
  • 1,905
  • 1
  • 15
  • 30
Atif
  • 10,623
  • 20
  • 63
  • 96
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,547
  • 4
  • 28
  • 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
  • 120,166
  • 34
  • 186
  • 219