title: How to configure passwordEncoder in spring security config if i use Md5PasswordEncoder for password encryption?
body: <h3>Encryption</h3>
  <pre><code>Md5PasswordEncoder md5PasswordEncoder = new Md5PasswordEncoder();
  md5PasswordEncoder.encodePassword(
      userRegistrationInfo.getPassword(), 
      AppConstants.MD5_PASSWORD_ENCODER_SALT);
  </code></pre>
  <h3>Spring Security Configuration</h3>
  <pre><code>@Autowired
  public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { 
   
     auth
        .userDetailsService(userDetailsService)
        .passwordEncoder(passwordEncoder());
  }
      
  @Bean
  public PasswordEncoder passwordEncoder() {
      PasswordEncoder encoder = new BCryptPasswordEncoder();
      return encoder;
  }
      
  </code></pre>
  <p>I need to use <code>org.springframework.security.authentication.encoding.Md5PasswordEncoder</code> for my password encryption. But I don't know how to configure <code>passwordEncoder()</code> in Spring security configuration.</p>