Possible Duplicate:
Ways around putting a password in code
If you create an application that for example connects to a database or an ftp server it needs a username and a password.
How do you recommend storing this?
First and easiest option is of course as plain text in the application, but then I guess it would be quite clear and visible if you somehow decompiled the application (or the application was already in clear text in the case of php etc.). But is there any way around this? Could of course encrypt it, but then you would have to decrypt it which (although I may be wrong) usually requires something like a password or a token of some sort. And then you are back at the beginning, cause where do you store that password/token?
What are some good practices in this area?