Tuesday, May 17, 2011

Encrypt a password in JPA persistent.xml

Below is a example how to encrypt password in JPA persistent.

1. Generate a encrypted password (See previous blog)
2. Add below entrance into spring applicationcontext.xml




PBEWithMD5AndDES


JAMES_PWD


4





strongHibernateStringEncryptor







3. change persistent.xml




value="org.jasypt.hibernate.connectionprovider.EncryptedPasswordDriverManagerConnectionProvider"/>

No comments:

Post a Comment