Java Chatter and Random Nagging

Thursday, September 27, 2007

Jasypt : encryption with great support for Hibernate and Spring

For my petproject, I was in the need of encrypting a few database columns. There is of course the full-fledged solution of Acegi Spring Security, but since I only needed encryption of a few database columns, I decided to go for Jasypt.

Using the following tutorial, I easily integrated Jasypt with my existing Spring/Hibernate/Echo2 stack. The only problem I encountered was a JCE problem, since I hadn't installed the unlimited
strength policy files
in the jre/lib/security directory. Since unlimited strength, was not what I needed anyway, I switched the algorithm PBEWithMD5AndTripleDES to PBEWithMD5AndDES and my transparantly encrypted database columns were a fact.

The only drawback I encountered was the dependency of Jasypt on the external library International Components for Unicode (ICU), which is over 4 megabyte. However, despite this fact, Jasypt is a great library, which gets you up to speed really fast.

Labels: , , ,


Post a Comment

<< Home