user3581054
user3581054

Reputation: 123

Is it secure to store password in C# code?

Is it secure to have a password as a plain string in the c# code? I will only have one user that will use the login feature. Thank you.

Upvotes: 4

Views: 1691

Answers (2)

BLoB
BLoB

Reputation: 9725

No it isn't secure, as the others have already said, it's not a complicated matter to decompile a dll etc and retrieve the source code...

Perhaps you could look into putting it an an app key in the web.config file and encrypt that using IIS... Have a read of this Microsoft walkthrough for encrypting the web.config connection string

Upvotes: 3

No, it's not safe. Many decompilers like reflectors can easily retrieve the password, main reason for it is code can be easily decompiled.

Upvotes: 1

Related Questions