java - Different hashCode for the same string? -


i have made log-in screen , want check password client enters passwords in server's database. if hashcodes match, password accepted. however, hashcode when write password on client screen different hashcode of received string (password) on server side.

does know why? in advance insight.

you've misunderstood.

  1. you should using secure hash, not thehashcode() method.
  2. you must not store plaintext password in database. must store hash.
  3. you should getting database hashing , comparison:

    select count(*) users username = ? , password = md5(?)  

    if query returns 1, user , password exist. if returns zero, don't. note don't want distinguish between wrong username , wrong password, information leak attacker. test them both above.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -