title: How Do I Separate The Salt from the Hash After Encrypting a Password with bCrypt using Java?
body: <p>OK, I am using Java with Spring MVC and Hibernate.  I am using bCrypt for password encryption for the first time. I understand doing in that bCrypt integrates the salt with the hash.  I have it set up currently so that the password is accepted as an input, is encoded with bCrypt, and is saved is one column of my SQL database.</p>
  
  <p>However, I would like to separate the salt from the hash and put store them separately.  I have read, and tried many things, but cannot find a way to do this. So if anyone can point me in the correct direction that would be a great assistance.</p>
  
  <p>This is what I have at present.</p>
  
  <p>This is the basic code to setup bCrypt. It takes my password string, and encrypts it.</p>
  
  <pre><code> BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();  
      String hashedPassword = passwordEncoder.encode(password);  
  </code></pre>
  
  <p>The below code takes the password and puts it into a single column in the DB.</p>
  
  <pre><code>    employee.setPasswordSalt(hashedPassword);
  </code></pre>