title: MD5 Hash in JSP for password - generates random hash each time
body: <p>For protecting passwords, hash value of that password is stored in database. I am using this code for generating hash value of a string: <a href="http://www.exampledepot.com/egs/javax.crypto/GenMac.html" rel="nofollow">http://www.exampledepot.com/egs/javax.crypto/GenMac.html</a></p>
  
  <p>But i found that it generates random hash for the same string each time. So i am not able to use it for password validation.</p>
  
  <p>How to make that code generate hash value based on the String only ? That is, if i input "iloveyou" it should generate the same hash value each and every time. Not a different one.</p>