Data Protection API

ASP.NET Core uses Microsoft.AspNetCore.DataProtection to handle the encryption keys used to protect state values that get posted between the app and the client.

The Machine.config keys are no longer used for data protection in ASP.NET Core. Data Protection is quite an extensive topic; you can refer to the Microsoft documentation (https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/) to know more about this.

The Cookie generation takes places using Data Protection APIs.

We will take a simple example of encrypting the ID values for a given entity.

Consider the BudgetCategory class having various properties that are uniquely identified by the ID. When we retrieve a list of budget categories or single objects, ...

Get Mastering ASP.NET Web API 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.