Alex Rivera | Logout

Encrypt password in configuration files

Asked 2009-07-15T16:47:21.170
142

I have a program that reads server information from a configuration file and would like to encrypt the password in that configuration that can be read by my program and decrypted.

Requirements:

  • Encrypt plaintext password to be stored in the file
  • Decrypt the encrypted password read in from the file from my program

How would I go about doing this? I was thinking of writing my own algorithm, but I feel it would be terribly insecure.

Edit
Report

1 Answer

1

Try using ESAPIs encryption methods. It's easy to configure and you can also easily change your keys.

http://owasp-esapi-java.googlecode.com/svn/trunk_doc/latest/org/owasp/esapi/Encryptor.html

You

  1. encrypt
  2. decrypt
  3. sign
  4. unsign
  5. hashing
  6. time based signatures and much more with just one library.
answered 2012-12-05T07:12:33.303

Your Answer