How to Create Your Own Encrypted Password Using PHP

| Last Updated: | In: WordPress Snippets


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.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:

Tags: , , , , ,