Believer
Believer

Reputation: 182

How to implement Rijndael (AES) algorithm to encrypt C# Windows Form C# app.config

I'm thinking if it's possible to implement Rijndael algorithm so that it can encrypt the connection string in the app.config file.

For example if I will run the program at first it will automatically change the connection string to an encrypted string.

Upvotes: 0

Views: 784

Answers (1)

Matthew Watson
Matthew Watson

Reputation: 109822

Rather than doing this yourself, you could use "Protected Configuration" to encrypt your configuration file.

Although this is primarily designed for use with ASP.Net, you can also use it for Windows Forms (and other) applications.

Here's a (fairly old) article about using Protected Configuration with a Windows Forms application on Code Project.

And here's a more recent article.

Upvotes: 2

Related Questions