-1

I am trying to encrypt a value and sending it through the URL. How do I encrypt and decrypt passwords or any value using the sha2() function in PHP?

please help. thanks in advance.

Robert
  • 5,278
  • 43
  • 65
  • 115
Utkarsh Singh
  • 283
  • 2
  • 12

1 Answers1

2

You can't decrypt password encrypted using sha2. You can encrypt value which user entered in form and compare it with this stored in ex. mysql database.

darkanzali
  • 85
  • 1
  • 1
  • 10
  • 1
    Arg, *why did you say ["encrypt"](http://en.wikipedia.org/wiki/Encryption)?* Incorrect terminology started - and perpetuates - this whole genre of question! Hashing is *not* encryption. – user2864740 Jan 22 '14 at 09:23
  • @user2864740 You're right, my mistake. – darkanzali Jan 22 '14 at 09:44