Hi Daniel,
Thank you. It worked
Code to register Jasypt for hibernate
Encrypting Hibernate Password
Code:
StandardPBEStringEncryptor strongEncryptor = new StandardPBEStringEncryptor();
strongEncryptor.setAlgorithm("PBEWithMD5AndDES");
strongEncryptor.setPassword("EncryptionPassword");
HibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry.getInstance();
registry.registerPBEStringEncryptor("configurationHibernateEncryptor", strongEncryptor);
After adding strongEncryptor.setAlgorithm("PBEWithMD5AndDES"); it worked
And strongEncryptor.setPassword("UR-ENCRYPTION-PASSWORD");
This password is the password which we have given for encrypting.
command to encrypt the password
Code:
encrypt.bat input="UR-DATABASE-PASSWORD" password=UR-ENCRYPTION-PASSWORD algorithm=PBEWithMD5AndDES
and hibernate file
Code:
<property name="connection.provider_class">org.jasypt.hibernate.connectionprovider.EncryptedPasswordDriverManagerConnectionProvider</property>
<property name="connection.encryptor_registered_name">configurationHibernateEncryptor</property>
<property name="hibernate.connection.password">ENC(CiyzIvJBgEseyCau8jxo6qgpGkZErLPj)</property>