Jasypt offers support for performing PBE (Password Based Encryption) operations on texts. This is offered through the org.jasypt.encryption.pbe.PBEStringEncryptor interface and its default implementation, org.jasypt.encryption.pbe.StandardPBEStringEncryptor.
Jasypt uses the byte (binary) encryption mechanisms as a basis for text encryption, with the following specificity:
Assuming that you will be using the default implementation, once the StandardPBEStringEncryptor instance has been created, this is how it will work:
The algorithm, password and key-obtention iterations can take values in any of these ways:
And the actual values to be used for initialization will be established by applying the following priorities:
Before it is ready to encrypt, an object of this class has to be initialized. Initialization happens:
An encryptor may be used for:
When using a random salt generator, two encryption results for the same message will always be different (except in the case of random salt coincidence). This enforces security by difficulting brute force attacks on sets of data at a time and forcing attackers to perform a brute force attack on each separate piece of encrypted data.
To learn more about the mechanisms involved in encryption, read PKCS #5: Password-Based Cryptography Standard.