title: Jasypt with the Bouncy Castle JCE SHA512 encryption
body: <p>I need: 
  <strong>password based encryption using sha512 digesting and 256 bit AES encryption with cbc and bc flags set</strong>.</p>
  
  <p>Seems that algorithm should be like this: <strong>PBEWithSHA512AndAES256-CBC-BC</strong></p>
  
  <p>but in my local env I get error: <em>org.jasypt.exceptions.EncryptionInitializationException: java.security.NoSuchAlgorithmException: no such algorithm: PBEWithSHA512AndAES256-CBC-BC for provider BC</em></p>
  
  <p>my test code:</p>
  
  <pre><code>import java.security.Security;
  
  import org.bouncycastle.jce.provider.BouncyCastleProvider;
  import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
  
  public class App {
  
  static {
      Security.addProvider(new BouncyCastleProvider());
  }
  
  public static void main(String[] args) {
      StandardPBEStringEncryptor mySecondEncryptor = new StandardPBEStringEncryptor();
      mySecondEncryptor.setProviderName("BC");
      // mySecondEncryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC");
      mySecondEncryptor.setAlgorithm("PBEWithSHA512AndAES256-CBC-BC");
      mySecondEncryptor.setPassword("pass");
  
      String myText = "Mindaugas";
      String mySecondEncryptedText = mySecondEncryptor.encrypt(myText);
  
      System.out.println(mySecondEncryptedText);
      System.out.println(mySecondEncryptor.decrypt(mySecondEncryptedText));
  }
  }
  </code></pre>
  
  <p>PBEWITHSHA256AND128BITAES-CBC-BC - this algorithm works fine but I need sha512 and 256 bit AES...</p>
  
  <p>I have installed extensions form: <a href="http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html" rel="nofollow">http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html</a></p>
  
  <p>but still get this error: <strong>no such algorithm</strong></p>