Jasypt 1.9.3 RELEASED! (May 25th, 2019) [DOWNLOAD and ChangeLogs] [WHAT'S NEW IN JASYPT 1.9]
Jasypt is a java library which allows the developer to add basic encryption capabilities to his/her projects with minimum effort, and without the need of having deep knowledge on how cryptography works.
Have a look at the complete set of Jasypt Features or check the FAQ.
With Jasypt, encrypting and checking a password can be as simple as...
StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor(); String encryptedPassword = passwordEncryptor.encryptPassword(userPassword); ... if (passwordEncryptor.checkPassword(inputPassword, encryptedPassword)) { // correct! } else { // bad login! }
...encrypting and decrypting a text...
AES256TextEncryptor textEncryptor = new AES256TextEncryptor(); textEncryptor.setPassword(myEncryptionPassword); String myEncryptedText = textEncryptor.encrypt(myText); ... String plainText = textEncryptor.decrypt(myEncryptedText);
...and what about encrypting some sensitive data directly from Hibernate?
<class name="Employee" table="EMPLOYEE"> ... <property name="address" column="ADDRESS" type="encryptedString" /> <property name="salary" column="SALARY" type="encryptedDecimal" /> ... <class>
But of course, besides easy, jasypt is highly configurable. You will be able to choose encryption algorithms, salt generation, initialization vector generation and many more advanced features...