I am writing a simple database application. The program should get database information (host,name,user,pass) and store them for next uses. So I need to encrypt them and store encrypted information in a file. On the other hand I don't want to put any passwords in program code. My question is how should I store key for encryption algorithm in program? (the key used for encrypt database information)
-
are you able to use a trusted connection?Daniel A. White– Daniel A. White2012-03-18 12:02:56 +00:00Commented Mar 18, 2012 at 12:02
-
@Daniel No. How is that related to storing password?Soroush Rabiei– Soroush Rabiei2012-03-18 12:04:56 +00:00Commented Mar 18, 2012 at 12:04
-
possible duplicate: stackoverflow.com/questions/469267/…Renato– Renato2012-03-18 12:10:12 +00:00Commented Mar 18, 2012 at 12:10
Add a comment
|
2 Answers
Put the key in an external file and make sure the file permissions allow only the application user to access it.
2 Comments
Renato
If you change the file permissions in Windows (I think from Vista) I think that would have a similar effect.... no?
Soroush Rabiei
I have no experience with security in windows. I think it's better to embed password into executable, probably using resources... Thanks