View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3820263#3820263

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3820263

There was a question on howto encrypt the database passwords showing up in the 
*-ds.xml files recently. Answer: you can't. This file is a simple configuration that 
does not support encryption. If your database supports hashed passwords, then you can 
use that, but specifying an encrypted key that needs decryption via another key is not 
supported.



You do not have to specify the username/password for a connection in the *-ds.xml file 
however. You can use JAAS to obtain this information however you want, including the 
handling of an encrypted password. An example login module has been added to the 3.2 
branch which demonstrates a simple way to do this. To use it with the default hsqldb 
database config, first remove the username and password settings from the 
deploy/hsqldb-ds.xml file. Then, edit the conf/login-config.xml file and change the 
HsqlDbRealm to the following:



<application-policy name = "HsqlDbRealm">

   

      <login-module code = "org.jboss.resource.security.SecureIdentityLoginMdule"

         flag = "required">

         <module-option name = "username">sa</module-option>

         <module-option name = "password">-207a6df87216de44</module-option>

         <module-option name = 
"managedConnectionFactoryName">jboss.jca:servce=LocalTxCM,name=DefaultDS</module-option>

      </login-module>

   

</application-policy>



The password here is the encrypted form supported by this login module and corresponds 
to the default empty string password. The password is encrypted/decrypted using a 
hard-coded cipher algo of Blowfish, and key derived from the phrase 'jaas is the way'. 
Get the code and adjust to your requirements.




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to