12.18. Encrypt and Decrypt Data Using the Data Protection API
You need a convenient way to securely encrypt data without the headache associated with key management.
Use the ProtectedData and ProtectedMemory classes of the System.Security.Cryptography namespace to access the encryption and key management capabilities provided by the DPAPI.
How It Works
Given that the .NET Framework provides you with well-tested implementations of the most widely used and trusted encryption algorithms, the biggest challenge you face when using cryptography is key management—namely the effective generation, storage, and sharing of keys to facilitate the use of cryptography. In fact, key management is the biggest problem facing most people when ...