Jump to content

md5 hashed password


wizzan

Recommended Posts

Hello

 

I was wondering what you add to this code to make it use md5 hash password (strPasswd)

 

 

 

 

<span class="textredlg"><b>Login to the ACP</b></span><br /><br />

<form action="./?page=store_acp" method="post">
<table align="center" width="100%">
    <tr>
        <td>Username:</td>
        <td><input type="text" name="strAccountID" value="" /></td>
    </tr>
    <tr>
        <td>Password:</td>
        <td><input type="password" name="strPasswd" value="" /> <input type="submit" value="Login!" /></td>
    </tr>
    <tr><td colspan="2" height="5"></td></tr>
    <tr>
        <td colspan="2" style="font-size: 9pt;"><%ERROR%></td>
    </tr>
</table>
</form>

 

 

 

 

Regards

Link to comment
https://forums.phpfreaks.com/topic/286565-md5-hashed-password/
Share on other sites

To that code, there's really nothing you can add to do it. You need to hash the password after the user posts the form.

 

Somewhere in your code there's something like $_POST['strPasswd']

 

to grab that value and hash it, you would do something like this:

$hashedPassword = md5(trim($_POST['strPasswd']));

Hope this helps

Link to comment
https://forums.phpfreaks.com/topic/286565-md5-hashed-password/#findComment-1470872
Share on other sites

Don't use MD5 for passwords. Not salted, not repeatedly hashed, not anything using MD5. Or SHA1. Neither of them are secure enough to use with passwords, and haven't been for years now.

 

Upgrade to PHP 5.5 if you can: it has functions like password_hash so you don't have to worry about password hashing. If you can't, there's a PHP version of it you can download and use.

Link to comment
https://forums.phpfreaks.com/topic/286565-md5-hashed-password/#findComment-1470877
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.