title: Spring security Custom hash algorithm
body: <p>I have a Spring Project that has been authenticated using Spring Security.</p>
  
  <p>Spring Security code snippet : </p>
  
  <pre><code>    &lt;authentication-manager&gt;
          &lt;authentication-provider&gt;
          &lt;password-encoder hash="md5"/&gt;
                  &lt;jdbc-user-service data-source-ref="dataSource"
  
                  users-by-username-query="
  SELECT users.LOGIN_NAME AS username,
     users.PASSWD_HASH     AS password , users.status as enabled
     FROM RV_USER users
    WHERE users.LOGIN_NAME=?"
                  authorities-by-username-query="
                        select users.LOGIN_NAME as username, authorities.ROLE_DESC as authority
  from RV_ROLE authorities, RV_USER users
  where authorities.ROLE_ID=users.ROLE_ID
  and users.LOGIN_NAME=?"
  
              /&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  </code></pre>
  
  <p>I want to use a custom hash algorithm rather than md5 or something else.</p>