0

So I have a connection string labeled as:

<connectionStrings>
    <add name="TBL_ClassServices" 
         connectionString="Server=(localdb)\MSSQLLocalDB; database=Assignment1; User Id=test; Password=test"
         providerName="System.data.sqlclient" />
</connectionStrings>

I just want to encrypt the User Id and the Password without encrypting the whole connection string itself. Is it possible, and if so, how would you encrypt it, and then decrypt it using aspx.cs (C# back-end) code.

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user3574842
  • 7
  • 1
  • 5

1 Answers1

0

I would suggest using a separate program to set the encrypted string into the config file and decrypt the string in your c# code whenever you need to read the connection string. Here is a helpful post for accomplishing this: Encrypt and decrypt a string

Icculus018
  • 1,018
  • 11
  • 19