Rated an average of 4.5 stars by 4 people

Crypt Password

Script Details:
Added on March 14, 2009 by Speedy. Last modified March 14, 2009.
Speedy accreditted the script to himself.

Description:
This function crypts a password to a 32 char md5(). Then wrapping the $hash around it creating a 64 char string, then it brings it back to a 32 char crypted password, making it impossible for hackers to backtrace the real password string

Tags: crypt, function, md5(), password, security

Instructions:
Call the function like any other functions:
$password = CryptPass('password');

Code:

<?php
# Snippet from PHP Share: http://www.phpshare.org

function CryptPass($password)
{
    
// Pick a random word and replace with hash
    
$hash[0] = md5('hash');
    
$pass md5($password);
    
$hash[1] = substr($hash[0], 016);
    
$hash[2] = substr($hash[0], 1632);
    return 
md5($hash[1] . $pass $hash[2]);
}
?>

Review this PHP Script:

Rating:

Comments:


Login

User:
Pass:

Register

Not a member? Register today and receive the many free benefits of being a member!

Advertisements