I have primary keys etc stored in java key store and I have hard coded the password for keystore for now but I am thinking to store that password in text file in encrypted form. The architect of my team does not want to store password for keystore in database so now I need two way hashing algo. to store password in text file and then read it back at server start.
Any idea from where I can get two way hashing algo in java ??
Or are there any other better means to store password for key store.
Yes, hashing is a one-way process. What you're talking about is encryption (which can be reversed, given the password).
But to encrypt the password (and later decrypt it), you'd need another password, which you would need to store in cleartext somewhere. And so on, and so on. So I don't think encrypting the keystore password buys you much (or any) security.
But since this is a server application, what problem do you see with storing the keystore password in cleartext in some file? Are the system admins untrusted? Or do you fear the system getting compromised from the outside?