How to get original password from BCryptPasswordEncoder
<p>I'm using spring security for my application. When a user register first time, their passwords are encrypted with <code>BCryptPasswordEncoder</code>.</p>

<pre><code>BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
String hashedPassword = passwordEncoder.encode(password);
</code></pre>

<p>Now, in case of password changing, users enter their current password and I need to check if this current password is same against the encrypted password that is saved in the database. </p>

<p>I know it is not possible to generate two same encrypted hash with same string with <code>BCryptPasswordEncoder</code>. So probably only way to compare the passwords if they are same is to get the original password that is saved in the database and compare with the current entered password. </p>

<p>So, is there any way to compare the passwords or to get the original password from the database saved hashed password?  </p>