Reputation: 2715
I have a class for encryption and decryption of Password from database. I have a secret key in config and a salt in my code.
If someone get access to dll and database then he can decrypt my data by importing dll to his application.
Is there something to protect calling method outside of dll
Upvotes: 2
Views: 2149
Reputation: 6683
I heartily recommend using the DPAPI for encrypting your app or web.config. It will help to ensure that the only way to decrypt that config is by doing so in your environment, simple file access is not enough.
http://msdn.microsoft.com/en-us/library/ms995355.aspx
Upvotes: 2
Reputation: 564413
Ideally, you shouldn't store passwords within your code, as decompilation is fairly easy.
The best option is to store this information in a secure location, and ideally only store hashes of the information.
That being said, there are various options you can do to help protect yourself.
One option is obfuscation, but this still only makes it more difficult, but not impossible, to discover your information. Some obfuscators are better than others, and will "break" most decompilation tools. That being said, as long as the computer can figure it out, a talented individual can as well.
Upvotes: 2