From what I understand, the best practice to store an encoded password (in java) is in a byte array and the password itself in a char array.
I'm using Spring security to develop an authentication system for my app. They provide a password encoder bean such as:
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
Which when I encode a password with it, it returns a String instead of byte array as suggested.
The question is, should I use this password encoder provided by Spring, or should I make an encoder service using pure java library such as here: https://stackoverflow.com/a/18143616/9942602 ?