| | |
Encryption in PHP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
You can't.
SHA is one-way encoding mechanism. So in order to verify a password, the verification string has to be encoded using the same key as it has been initially encoded upon inserting into the database.
You have to choose another method of encoding, which provides decoding as well.
However, i think that you better provide password recovery either by sending a link to the customer's email where he can follow it and change the password, or generate a random string and send it to the customer in an e-mail as a default password.
The SHA hashing mechanism is secure enough, so i don't suggest you going for change of the encoding mechanism.
SHA is one-way encoding mechanism. So in order to verify a password, the verification string has to be encoded using the same key as it has been initially encoded upon inserting into the database.
You have to choose another method of encoding, which provides decoding as well.
However, i think that you better provide password recovery either by sending a link to the customer's email where he can follow it and change the password, or generate a random string and send it to the customer in an e-mail as a default password.
The SHA hashing mechanism is secure enough, so i don't suggest you going for change of the encoding mechanism.
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
I miss my mind the most...."
Mark Twain
•
•
•
•
I am developing a website which encrypts every user's password with sha1() method and is stored in the database.
Now the problem is I want to offer a recover password function for my users. but i dont know how to get the password from the salted string
Help me!!!
Storing passwords in a way that they can be decrypted is useless since you would have to store the key where your application can retrieve it. Thus if your application is compromised, all the passwords will be as good as stored in plain text.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- Java Encryption and Decryption (Java)
- SMS Message With PHP/MYSQL (PHP)
- Hide right click option usnig php (PHP)
- help with/removing window's encryption on my data (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: blog software
- Next Thread: PHP Cookies Tutorial
| Thread Tools | Search this Thread |
ajax apache api array arrays beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external file files folder form forms forum function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail malfunction menu method mlm multiple mysql neutrality oop paypal pdf php phpmysql play problem query question radio random recursion regex remote root script search select server sessions sms soap source space sql syntax system table tutorial update upload url validator variable video web xml youtube






