How to Create Your Own Encrypted Password Using PHP

Create your own encrypted password using php

If you are developing a password-protected web site, you have to make a decision about how to store user password information securely. You can use predefine password encryption method.

Unsuitable for passwords for your Application

Why are common hashing functions such as md5 and sha1() unsuitable password for your application, because of now a modern computer can “reverse” these hashing algorithms, many security professionals strongly suggest against their use for password hashing. You can create your own password encryption using password_hash() see example bellow :

Above example will output the password which is similar to :

$2y$11$q5MkhSBtlsJcNEVsYh64a.aCluzHnGog7TQAKVmQwO9C8xb.t89F

How to storage encrypted password Model in database

password_hash() is used to hash given string using strongest algorithm currently available to stored password in database. See the bellow example how to stored password using password_hash() method.

Share your love to share this post with your friends and join us on Facebook to be the first to learn the next great thing from freewebmentor.

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected].com. Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Article Tags: , , , , ,