0

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)

sorush-r
  • 10,490
  • 17
  • 89
  • 173

2 Answers2

3

Put the key in an external file and make sure the file permissions allow only the application user to access it.

Renato
  • 12,940
  • 3
  • 54
  • 85
  • If you change the file permissions in Windows (I think from Vista) I think that would have a similar effect.... no? – Renato Mar 18 '12 at 12:14
  • I have no experience with security in windows. I think it's better to embed password into executable, probably using resources... Thanks – sorush-r Mar 18 '12 at 12:18
0

You can use a Machine ID such as a CPU sn, but you won't e able to move te file to another system.

vy32
  • 28,461
  • 37
  • 122
  • 246