Login script using md5 encryption
Posted: Thu Feb 26, 2004 7:46 am
I've written a small login script using md5 encryption and I want to know the weakness of this kind of approach. There must be a reason people usually store username and password in a database?
Anyway, here is the code. Please comment:
/ phreud
Anyway, here is the code. Please comment:
Code: Select all
<?php
$uname_entry = md5($_POSTї"uname"]);
$passwd_entry = md5($_POSTї"passwd"]);
$uname = "f542af5d23c2f90b1d2c8d519144b509";
$passwd = "c3c20e2d371b2cfea1bbd80d1d474cd6";
if (($uname_entry == $uname) AND ($passwd_entry == $passwd))
{
//Logged in
}
else
{
//Not logged in
}
?>