thedev
thedev

Reputation: 2886

Where to store db access password in winforms app

My app is using a unique password to access a MS Access database. Currently this is stored as plain text in a settings project.

What would be the best place to store this?

Thanks, Alex

P.S. A colleague recommends source code obfuscation. What do you think?

Upvotes: 2

Views: 2664

Answers (3)

Dennis Traub
Dennis Traub

Reputation: 51624

Code obfuscation itself doesn't help you there since it's a method to hide the intend of your code by renaming classes, methods and properties. You're looking for encryption. Various code obfuscation tools also offer an option to encrypt literal strings.

Upvotes: 1

vladimir
vladimir

Reputation: 11

If you look at google "recover access database password" you can see that password is not a protection for mdb. Maybe it is better to encrypt critical data inside WinForms application (for example by application user passwor - not mdb user password) and then store encrypted data to mdb.

Upvotes: 0

Tim Rogers
Tim Rogers

Reputation: 21713

You'll want to look into the ProtectedData class. There's a good article here about how to encrypt passwords and store them in the app.config file, although you should be able to use the same approach wherever you store your passwords.

Upvotes: 1

Related Questions