Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, there is several parts to this.</p> <ol> <li>You need to try to make it difficult to get to your db and passwords in the first place, keep them secure. This includes not making your passwords cleartext and not using a symmetric encryption algorithm.</li> <li>You need to use a <a href="http://en.wikipedia.org/wiki/Salt_%28cryptography%29" rel="nofollow">salt</a>. Doing this prevents people from using a precomputed lookup table (i.e. rainbow table) or something like <a href="http://md5.rednoize.com/" rel="nofollow">http://md5.rednoize.com/</a>. Pick some data for your salt that is both <em>unique</em> and <em>unpredictable</em>. I usually use a random 32 bit value, but I wouldn't go much less.</li> <li>Some algorithms are stronger than others. This is defined in a couple ways <ol> <li>How fast it can be computed. Longer is better. The faster the attacker can calculate hashes, the better the odds are for a bruteforce attack.</li> <li>If the algorithm has no known weakness which reduce the search space. For example, the number of bits in an md5 hash is misleading because there are <a href="http://en.wikipedia.org/wiki/MD5#Collision_vulnerabilities" rel="nofollow">known attacks</a> that reduce the actual search space</li> </ol></li> </ol> <p>As of today I think <a href="http://en.wikipedia.org/wiki/SHA-1" rel="nofollow">SHA1 or SHA2</a> with a salt is reasonably secure for the near future. There is a utility called <a href="http://bcrypt.sourceforge.net/" rel="nofollow">bcrypt</a> which uses an asymmetric variant of blowfish and has the concepts of salt and computational expense built-in, it might be worth checking out.</p> <hr> <p>Edit: I wanted to clarify what a salt is, as there is a <strong>lot</strong> of misconception about it on SO and online.</p> <h2>What a Salt is <strong>not</strong></h2> <p>A secret, pre-agreed upon string that you hash with the password. This is a secret key, not a salt.</p> <h2>What a Salt is</h2> <p>You include the salt (unique and unpredictable per hash) along with your password when hashing, but you also include a <strong>unencrypted</strong> copy of it <strong>outside</strong> of your hash, so that when verifying the hash later you are able to include the same salt when given a test password before hashing it so you can properly compare the hash.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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