File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Encrypting and Decrypting .properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Encrypting and Decrypting .properties file" Watch "Encrypting and Decrypting .properties file" New topic

Encrypting and Decrypting .properties file

vi tri

Joined: Apr 16, 2012
Posts: 1
Encrypting and Decrypting contents of .properties file

I am new to java security API.I want to encrypt the contents of the file and write it back in the same file and whenever those contents are to be used by java code they are to be decrypted and then used
Tim Moores

Joined: Sep 21, 2011
Posts: 2413
See for some introductions and example code of how to use JCE, which is the standard Java API for encryption. Note that you should no longer use DES, but AES instead.
Pat Farrell

Joined: Aug 11, 2007
Posts: 4659

Note, this is probably a bad idea. It is unlikely to give you the security that you think you could gain with this approach.

You could have to describe what you are trying to do before I could make better comments.
I agree. Here's the link:
subject: Encrypting and Decrypting .properties file
jQuery in Action, 3rd edition