I'm perusing the JCE JavaDocs and intro docs and I'm a little lost. (I'm using JDK 1.5.0_17 by the way)
All I want to do is take a couple of strings and encrypt them with a simple password or key (symmetric) and store them as ASCII/UTF-8 in a text file. And then unencrypt in the code.
Context: I work in the retail space and there's a bunch of retail stores that will have store servers with configuration files for
Java programs. Some of these config files will have lines that say,
ldap_password=password
I would rather it say something like,
ldap_password=3s9vj93DShjDSSG939f0
Where the 'key' or 'password' to unlock the encryption is just hard-coded in the JAR file that contains the application. Granted, someone can decompile the JAR, but this level of security is acceptable for our purposes.
Is there a simple way to just say, convertStringToGobblygook(s, key) and then the reverse?
It looks like I can use Cipher, CipherInputStream and CipherOutputStream wrapped over a StringReader/Writer or whatever. But even then, I'm getting confused as to the exact parameters to feed to the Cipher class.
Note that I don't need a fancy 1024-bit RSA blah-blah-blah encryption. Just something moderately better than, say, using ObjectOutputStream.
Help?