title: Spring Security : Encrypt password
body: <p>I am using spring 3.2.5. Righ now i am hashing password using </p>
  
  <pre><code>        MessageDigest messageDigest = MessageDigest.getInstance("SHA-512");
          messageDigest.update(password.getBytes("UTF-8"));
          byte[] digestBytes = messageDigest.digest();
  </code></pre>
  
  <p>I want to secure password using methods provided by spring. I searched internet and most of the post are very old. So any example will be fine.</p>