C#C
C#3y ago
uselessxp

❔ WebAPI .NET 7.0 - Encrypt connectionstring in appsettings.json

guys, I'm writing some WebAPI using .NET 7.0, and I'd like to secure the connectionstring with encryption, I found a guide that suggest to do it by using C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe is it a good way or is something old?

currently the connectionstring is placed into appsettings.json (not into web.config) and this is its content:
{
  "ConnectionStrings": {
    "Default": "Server=127.0.0.1;Database=mydb;User Id=testuser;Password=testpwd;TrustServerCertificate=true"
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "AllowedHosts": "*"
}
Was this page helpful?