I wish to create a table for passwords that may be known as upon with a foreign key in the table user to ensure that they are able to type their password and it'll go within the table and encripted safely. I have come across encrypting it having a hash and that i looked throughout but have no idea using it apart from things i saw within this video http://www.sqlshare.com/Player.aspx?vid=626&plid=&searchid=177388

Any help could be greatly appreciated

In a nutshell, you utilize a 1 way hash for example sha1 or md5 to show the password into a bit of text. That cannot be un-tied. You keep hash inside your database.

Once the user makes its way into their password, you hash their password in the same manner, then see if that's inside your database.

If they would like to totally reset the password, you are making up some random string that's pretty lengthy, then send them an email in the account your registered all of them with. They visit a link to that string because the GET parameter. You see if it is the right string, and when so request for any new password, hash it, and store within the database.

To obtain this working safely, you need to educate yourself on md5, sha1 and salting hashes.

What Ron states is just right, clearly you will find more techniques to authenticating the consumer to be able to alter the password apart from " some random string that's pretty lengthy".

If you wish to learn more about one-way hashes and also have a good example to see, I recommend getting a glance at this book: WickedCoolPHP

It's assisted numerous quantity of occasions both with quick scripts for you to use with better understanding PHP.