Join Login


Video Tutorials
Blog



Adobe Education Store

Password Encryption with MD5, SHA1, and Crypt


By: RiverCityGraphix      Views: 4805      Share: Bookmark and Share

In this tutorial, you will learn how to encrypt passwords and other data by using the md5, sha1, and crypt functions.

Password and other sensitive data protection is very important in web development. Users want to know that their data is secure and protected. Not only does it protect users, but also the integrity of your site. By encrypting passwords you are making it harder for hackers to use any information that they might obtain from a database. In the tutorial I discuss three of the main encryption types: MD5, SHA1, and Crypt. These have or will be broken so it is important to use a variety of them to encrypt data. That will make it nearly impossible for a hacker to decipher the original data from the randomized nonsense. This is an important step all developers should take before putting passwords into a MySQL database.

<?php

$mainpass = "test123";

$md5pass = md5($mainpass);
$sha1pass = sha1($md5pass);
$cryptpass = crypt($sha1pass,st);

echo "$cryptpass <br />";

?>




Free Source Files Zip

Adobe Master Collection CS5.5