0

Possible Duplicate:
How do you embed app.config in C# projects?

I'm using app.config file for connection string configuration, also i'm using Enterprise Library for Logging that, so my app.config file includes some valuable data, and i want to hide them from end user, is there any way(for example putting app.config in exe) for hiding this data?

Community
  • 1
  • 1
Masoud
  • 8,020
  • 12
  • 62
  • 123
  • Why won't you just make a static class with encrypted constants? Seems like you don't need that app.config at all. – Anri Jan 29 '13 at 14:52
  • to Anri: for hiding connection string, your way is acceptable, but Enterprise library put its information in app.config automatically. – Masoud Jan 29 '13 at 14:54
  • @Masoud What about encrypting the connection string by, for example, `RijndaelManaged` and saving it back to the `app.config`? You may then decrypt the connection string and get the data if required. Have a nice day :) – Picrofo Software Jan 29 '13 at 14:57
  • I would suggest embedding this as a resource and then using a .Net obfuscation product to do resource encryption so that people with reflector can't just open up your executable and see it – Earlz Jan 29 '13 at 15:01
  • for hiding connection string, your way is acceptable, but Enterprise library put its information in app.config automatically. – Masoud Jan 29 '13 at 15:01
  • 1
    If someone can *run* the application, they can also decompile it and see these hidden secrets. If you don't want users to see your secrets, don't hand them out in the first place – Damien_The_Unbeliever Jan 29 '13 at 15:31
  • @Damien_The_Unbeliever of course, but you can make it harder for them at least by not putting it in plain sight. But yes, if they can run your code, then they have access to all the secrets your code knows – Earlz Jan 29 '13 at 15:38

0 Answers0