How to do it...

  1. In the console application, locate the App.config file. This is the file that contains the sensitive data.
  2. If you open the App.config file, you will see that, within the appSettings tag, there is a key added called Secret. This information should probably not be in the App.config to start off with. The problem here is that it might be checked into your source control. Imagine that on GitHub?
        <?xml version="1.0" encoding="utf-8"?>         <configuration>           <startup>              <supportedRuntime version="v4.0" sku=".NETFramework,             Version=v4.6.1"/>           </startup>           <appSettings>             <add key="name" value="Dirk"/>             <add key="lastname" value="Strauss"/>              <add key="Secret" value="letMeIn"/>           </appSettings>         </configuration>
  1. To overcome this vulnerability, ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.