If you are looking for advice on using Jasypt with the Bouncy Castle JCE Provider, although this guide will also be relevant for you, you can also have a look at the specific Jasypt + Bouncy Castle integration guide.
Jasypt has an open JCE provider API which allows the developer to use any existing JCE provider for message digesting or password encryption from jasypt.
What this means is that any existing algorithms for both digests or PBE can be used in jasypt, as long as you have a JCE provider which implements it.
Note that your Java VM (let's say Sun's) already ships with a default JCE provider, which is the one which will be used by jasypt if you do not specify any.
For you as a non-specialised developer, it will be good to know that a JCE provider is just a piece of software which implements encryption algorithms, and which bundles at least one class that implements the java.security.Provider interface.
This class will be the one that we will call "the provider", and one of its methods, getName() will allow us to know the name with which this provider will be registered at our security framework, if we do so (see below).
If we want to use an algorithm shipped with a specific provider from our code, we have three choices:
Using a non-default JCE provider in jasypt for both message digesting or password-based encryption is really straightforward. You have two options:
Some examples (using the Bouncy Castle provider):
... Security.addProvider(new BouncyCastleProvider()); ... StandardPBEStringEncryptor mySecondEncryptor = new StandardPBEStringEncryptor(); mySecondEncryptor.setProviderName("BC"); mySecondEncryptor.setAlgorithm("PBEWITHSHA256AND128BITAES-CBC-BC"); mySecondEncryptor.setPassword(myPassword); String mySecondEncryptedText = mySecondEncryptor.encrypt(myText); ...
... StandardStringDigester digester = new StandardStringDigester(); digester.setProvider(new BouncyCastleProvider()); digester.setAlgorithm("WHIRLPOOL"); String digest = digester.digest(message); ...