Password Encryption using md5() function In PHP

Suppose you are developing a login module with the user name and password and want to save the password into the database in the encrypted format, so that the login is more secure from the hackers. In this post I am trying to describe the password encription by using the md5() php function.
	md5($pass);//Encryption of the password to make it more secure

By the Screenshot given below you can differentiate that md5() converts the same password admin into the long string, so that it is more complicated that someone can crack your password easily.


Password generated by the md5() is not the random numbers it is fix means every time if you will encrypt the “admin” then you will get the same result “21232f297a57a5a743894a0e4a801fc3”;

Implementation of the md5() into the Login form:

	//Fetching username and password sent from form 

	// Password Encryption 
	$query="SELECT * FROM user_data WHERE userId ='$username' and user_password ='$new_password'";

but don’t forget to save the password into the Encrypted form when user is doing Signup or Registration. Create the Login Module Click Here.

You have done, now use the secure feature of the PHP, Thanks and Enjoy the coding.