ASP.NET Core includes a new data protection system that can be used in web applications and console applications. You may recall that the list of templates for ASP.NET Core include a console application that we have not needed to use in previous chapters and shown in the following screenshot. However, this project type would be a great choice for illustrating framework features, such as the use of data protection in ASP.NET Core:
The <machinekey>
element was used in prior versions of ASP.NET, and the new data protection stack is intended to be its replacement. To make things easier, the new system encourages its use with minimal configuration effort. At the same time, there are extensibility APIs that allow more customization as needed.