activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "au.pg" <pgov...@interwoven.com>
Subject Re: encrypt database password in broker-config.xml
Date Wed, 11 Nov 2009 02:23:01 GMT

Hi,

I just want to share how we can encrypt database password in
broker-config.xml using jasypt.

1) Add spring name space

xmlns:spring="http://www.springframework.org/schema/beans" 

2) define below two beans 

<spring:bean id="configurationEncryptor"
class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
     <spring:property name="algorithm" value="PBEWithMD5AndDES"/>
     <spring:property name="password" value="pg"/>
 </spring:bean>

 <spring:bean id="propertyConfigurer"
    
class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer">
   <spring:constructor-arg ref="configurationEncryptor" />
   <spring:property name="location"
value="classpath:activemq-pwd.properties"/>
 </spring:bean>

3) you can see that password declared in activemq-pwd.properties can be
accessed as ${password} 

    <property name="password" value="${password}"/>  

4) below are contents of activemq-pwd.properties

password=ENC(oD2k3oXlEi4+6ovhpR2b3UguNfa/8UwU)

Please note that the generated password in activemq-pwd using jasypt's
encrypt.bat using above mentioned algorithm PBEWithMD5AndDES and password
pg.

PG
-- 
View this message in context: http://old.nabble.com/encrypt-database-password-in-broker-config.xml-tp25966501p26294445.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message