facebook

JASYPT -for hibernate configuration encryption

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #307337 Reply

    Srinivasa Ragavan
    Participant

    I need a help on getting database passwod encryption in hibernate.cfg.xml.

    I have followed hibernate + jasypt forum/procedure to encrypt hibernate.cfg.xml content (database password) and retrieving through registering the encryptor before creating database session.

    1. my hibernate.cfg.xml contains following lines:
    <property name=”connection.provider_class”>
    org.jasypt.hibernate.connectionprovider.EncryptedPasswordDriverManagerConnectionProvider
    </property>
    <property name=”connection.encryptor_registered_name”>
    configurationHibernateEncryptor
    </property>
    .
    .
    .
    <property name=”connection.password”>ENC(NIB1ua0P4w2DhJoVjX+Uag==)</property>

    2. Added following lines in HiberateSessionFactory.java before getting session (basically registering the jasypt encryptor)

    StandardPBEStringEncryptor strongEncryptor = new StandardPBEStringEncryptor();
    strongEncryptor.setAlgorithm(“PBEWithMD5AndDES”);
    strongEncryptor.setPassword(“mypassword”);
    HibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry.getInstance();
    registry.registerPBEStringEncryptor(“configurationHibernateEncryptor”, strongEncryptor);

    But after these 2 steps, part of HibernateSessionFactory which gets session
    sessionFactory = configuration.buildSessionFactory();
    hangs for every. It does not even throws any exception.

    Could you please confirm whether these steps are correct or any example code available to implement JASYPT for hiberate.cfg.xml encryption.

    Thanks in advance
    Manoj.

    #307351 Reply

    Brian Fernandes
    Moderator

    Manoj,

    I’m afraid this is a question you will need to ask on the JASYPT forum as it appears to be a problem with how you have used JASYPT. Sorry we could not be of more help.

    Moving to OT > Soft Dev.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: JASYPT -for hibernate configuration encryption

You must be logged in to post in the forum log in