Note that there are some explanatory texts on larger screens.

plurals
  1. POIs MD5 still considered secure for single use authentications?
    primarykey
    data
    text
    <p>Everyone is shooting down MD5 these days for its issues in the context of storing passwords. But what about uses where I just want to add a layer of authentication to something that will likely be used once?</p> <p>This is just a hypothetical example, but let's say I have a feature to allow a user to reset their password. I email the user a link that they can click to set a new (randomly-generated) password.</p> <p>My current thinking is that I'll generate an MD5 hash, using a private salt value, and a couple of identifying variables, and use that to create the link.</p> <p>Let's say the salt for this feature is "8b769a378411b705" (I use the same salt for all reset password requests). The other identifying pieces of data are the user ID and a database ID of the already-generated password hashes.</p> <pre><code>salt = "8b769a378411b705" (private) user_id = 123 pw_id = 456 code = md5(salt + " " + user_id + " " + pw_id) </code></pre> <p>which becomes</p> <pre><code>code = "692a71cd7da194145be209e40fcd3e92" </code></pre> <p>example link: <strong>confirm_reset_password.php?user_id=123&amp;pw_id=456&amp;code=692a71cd7da194145be209e40fcd3e92</strong></p> <p>Is this considered safe, in light of the issues with MD5? Is there another one-way hash I should consider using, like SHA-1?</p> <p>I've been using PBKDF2 with SHA1 for storing passwords, and I understand that part of its benefit is in its "slowness" and how long it takes to generate hashes. I could generate those higher-quality hashes for purposes like this, but I think it can backfire, since you could easily bring a server to its knees by bombarding it with (incorrect) requests, since each one results in a significant CPU job to generate the hash (especially since I am using lots of iterations). It seems that having a "fast" algorithm is good for single use purposes, but I'm wondering if MD5 is still the best choice.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload