Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li>Never never never hold password in open format in database. If someone find exploit in system, he will be able to make any sql query and get users passwords. And hacker will be able to login into system as user, because he knows username and password</li> <li>If user want restore password, make functionality for regenerating password. Never store password in plain text.</li> <li>SHA256 is hash function. Mathematically it means - data can be "hashed" only in one way. I mean, that from hash you cannot restore data. You can read this <a href="http://en.wikipedia.org/wiki/Hash_function" rel="nofollow">http://en.wikipedia.org/wiki/Hash_function</a> about hash functions and this about <a href="http://en.wikipedia.org/wiki/Sha256" rel="nofollow">http://en.wikipedia.org/wiki/Sha256</a> sha256 Result: If someone crack you database and get username and password, he is unable to login into system. Because hacker have only hash data and can't get exactly password for login.</li> <li>As i mentioned before, hash function can be "hash" data only in one way. But some hackers build VERY big data massive for some predefined algorithms. I mean, that they build hash tables for passwords. Such hash tables looks something like this:</li> </ol> <pre> password hash ------------------ a some_hash1 b some_hash2 ... ..... qwerty some_hash3 some_data some_hash3 -- yes, data can have collisions. See wiki about hash functions </pre> <p>And if hacker hacked you database and have such table, he able to restore password. For example, hacker get for admin user hash "some_hash3", then hacker search such hash in hash table, find that hash "some_hash3" have password "qwerty" and "some_data" and hacker will try to login with such passwords. Result: Use salt. For nowadays hackers have such tables for 6 symbols passwords. But you can "suck" them in very simple technic: When you store password in database, add to password some value (salt) and get from such value hash:</p> <pre><code>// somewhere in code, where creating/updating users password $password = hash('sha256', $salt.$password); </code></pre> <p>and when you will check password, use the same logic</p> <p>Thanks</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