System.Security.Cryptography.ProtectedMemory Class

Provides methods for protecting and unprotecting memory. This class cannot be inherited.

See Also: ProtectedMemory Members


public sealed class ProtectedMemory


This class provides access to the Data Protection API (DPAPI) available in the Windows XP and later operating systems. This is a service that is provided by the operating system and does not require additional libraries. It provides encryption for sensitive data in memory.

The class consists of two wrappers for the unmanaged DPAPI, ProtectedMemory.Protect(Byte[], MemoryProtectionScope) and ProtectedMemory.Unprotect(Byte[], MemoryProtectionScope). These two methods can be used to encrypt and decrypt data in memory.


Namespace: System.Security.Cryptography
Assembly: System.Security (in System.Security.dll)
Assembly Versions:,
Since: .NET 2.0