Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End php is a pain…

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #31524
    mshort1985
    Member

    this is just not my day for PHP errors… how is it possible that sha1(‘password’) can give 2 entirely different hashes to the same password in 2 different files. my register file inputs a hashed password into the database, and my login script searches for an entirely different hash for the same password…

    #62500
    gno
    Member

    That should not be possible. Maybe the length of the column in your database storing the hashed password is too small? Meaning that the stored password will be cut in length and thus not match the new one generated later?

    sha1 hashes are 40 digits/letters long.

    A viable alternative is md5- which is 32 digits/letters long.

    #62510
    clokey2k
    Participant

    Also be careful that no spaces or other characters are being sent to ‘sha1’ in either script. Trailing spaces can change the hash.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.