Spring Bcrypt is not working in my Web Application. I've Spring 3.1.0 version in my application. Here I'm sharing some sample code what I tried.
BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
System.out.println(encoder.matches(pwd, dbpwd));
It prints false
even if I enter correct password. But some times if I enter wrong password it prints true
. I'm saving encoding password in Database after encode
pwd = new BCryptPasswordEncoder().encode(pwd);
Why it's behaving in different ways. Am I missing anything here. Please correct me if I did wrong.