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

Edited by wizzan
Link to comment
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.