What problem does it solve?
Protects sensitive application data, tokens, and cookies stored at rest by providing guidance to use the ASP.NET Core Data Protection API for encryption, key management, and isolation across services.
Core Features & Use Cases
- Automatic key management and rotation: configure key lifetimes and storage so keys are rotated and persisted reliably.
- Purpose-isolated protectors and time-limited tokens: create separate protectors for tokens, API keys, and sensitive fields and issue expiring tokens for password resets or confirmations.
- Distributed key storage options: persist keys to the file system, Redis, or Azure Blob Storage with optional Key Vault protection for web farms and microservices.
- Encrypting database fields and cookie protection: apply protectors in Entity Framework value converters and ensure authentication and antiforgery tokens are protected.
- Use Case: implement time-limited password reset tokens and store API keys encrypted in the database while sharing key material across a load-balanced web farm.
Quick Start
Configure AddDataProtection in Program.cs with a consistent application name and persist keys to a shared store such as Redis or Azure Blob Storage to enable safe encryption of tokens and sensitive fields.