0

I want to encrypt the connection string, username and password to paste in Web.config file. At Web API level, before calling the db, I want to decrypt the connection string, username and password.

Please suggest any good .Net built in algorithms which do the same.

Sh.Imran
  • 1,035
  • 7
  • 13
AMDI
  • 895
  • 2
  • 17
  • 40

1 Answers1

0

The link would probably work for you: Encrypting & Decrypting a String in C#

Encrypt your connection string, username and password through the Console program and paste in the Web.config keys. For using in Web API, fetch encrypted strings from Web.config keys and decrypt them before the DB call.

Sh.Imran
  • 1,035
  • 7
  • 13