Hide mail server credentials in source

I have a desktop application that sends e-mail using a remote smtp server. So in the code, I have something like this:

string userName = "Alex";
string pass = "123456";
sendEmail(userName, pass);

Anyone who changes my application will have access to my mail server. I wonder if there are any solutions to protect sensitive data (userName, pass) from reversing? No obfuscation.

Thanks, Alex.

+3
source share
4 answers

Move your SMTP credentials and other sensitive data to app.config and use section encryption.

+4
source

, , - , .

, SMTP- smarthost, , -. , SMTP, .

:

  • - , .
  • SMTP-.
  • SMTP (, -), , , .

, , - .

+2

- , , , , . , - . .

0

Have you tried to confuse the application? Try Dotfuscator Software Services to confuse your code and then see if it can hide / obfuscate your username and password. It is best to use the app.config or web.config file to save your credentials using encryption or a hash.

There is never a good practice for hard credentials in an application.

-1
source

All Articles