tags:

views:

75

answers:

3

Hello. I develop application with Java. I need to store some initial configuration data in some kind of file.

I want my app to be able to read this data, but I don't want user to do so.

Example : application loads IP from encrypted file. User sees like "dsda@#21da@" so he won't bother doing anything :)

How should I do such a thing? Thanx!

+1  A: 

Are we talking about standard users or IT-savvy users?

For standard users i'd recommend to store the string base64 encoded. Or Just in an undefined binary format.

Otherwise... encryption with a hardcoded key?

lajuette
well password for database user will be there - so "quite" hot data. What do you think?
Mike
i can't think of a way to store such information in a really secure manner.What abbout wrapping all requrired services/databases with another layer of services, that control access to the underlying layer?i wouldn't deploy an application, that contains sensitive information like passwords or direct access to sensitive systems.
lajuette
I am afraid it is too small for such a thing, but thanks
Mike
A: 

If (as you say) you manage user passwords, you should not store them at all. Clear text, static keys, custom keys, it doesn't matter - someone with access to the data store and your program will always be able to retrieve them. What you do instead is use salt and a good hash function and store/compare only the hash values.

Kilian Foth
well the thing is:1. you connect to application as application user - entering username and password (there are lot of application users)2. application user automatically connects to database as database user - and this password needs to be stored
Mike
A: 

Possibly OT, but since you mentioned it is configuration data; I know I'd be a little peeved to have gibberish shown to me by an application. Either allow the users to see the data, and modify it at their risk ... or do not allow the configuration to be visible at all.

As a rule of thumb, if it is sensitive data ... don't store it in your application.

Everyone