aspose file tools*
The moose likes Spring and the fly likes Spring DataSource Defination With Secured Password Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring DataSource Defination With Secured Password" Watch "Spring DataSource Defination With Secured Password" New topic
Author

Spring DataSource Defination With Secured Password

Gagan Tiwari
Ranch Hand

Joined: Jun 10, 2008
Posts: 68
Hi All,

I am trying to acheive the following
1. In the Creation of the DATASOURCE Bean in Spring Configuration file , the password should be encrypted.

Now we have a way to encrypt/decrypt the password. Now the problem is to how we should set the same in the DataSource Defination.

I looked into the API and found out the following
a) DriverManagerDataSource. The issue is that it dosen't supports the Connection Pool.

Also the other way which I was possibly trying to do is to read the ENCRYPTED password from the Spring file and decrypt the same and store it in Some Statis Fields (At the Application Level) and wire this in the bean attribute.
Can you guide me as to how we can define the Application Level Variable in Spring and How to attach the same to a BEan's property.

Or is there any other way to get the ENCRYPTED Password implementation in Spring
Mudassar Hakim
Greenhorn

Joined: Jul 04, 2010
Posts: 25
Once we had this requirement we hardcoded md5() in the sql statement itself to save the encrypted password & also did similar changes in the applicationSecurity.xml having code as


I hope thats what problem was , if possibly if I have misinterpreted the problem kindly pardon me & would request for more detailed explanantion.


Mudassar Hakim, hakim_mudassar@rediffmail.com
SCJP, SCWCD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Spring DataSource Defination With Secured Password
 
Similar Threads
Best approach for simple case.
Crypting text with Java and salt
Store JDBC connection password
Encrypted Password for Oracle JDBC
Storing a password to encrypt/decrypt sensitive data.