System.Security.Cryptography.ProtectedData 10.0.11

About

System.Security.Cryptography.ProtectedData offers a simplified interface for utilizing Microsoft Windows DPAPI's CryptProtectData and CryptUnprotectData functions.

Note: Since it relies on Windows DPAPI, this package is only supported on Windows platforms. For more complex cryptographic operations or cross-platform support, consider the System.Security.Cryptography namespace.

Key Features

  • Built upon the robust and secure Windows Data Protection API (DPAPI).
  • Data can be protected either for current process or for any process on the machine.
  • Scope of protection can be defined either to the current user or the local machine.

How to Use

Utilizing this package is quite simple, and it mainly revolves around two methods: Protect and Unprotect.

Here, originalData is the data you want to protect, optionalEntropy is an additional byte array used to increase encryption complexity, and DataProtectionScope specifies whether the data protection should apply to the current user or the machine.

using System.Security.Cryptography;
using System.Text;

byte[] originalData = Encoding.UTF8.GetBytes("This is a secret");
byte[] optionalEntropy = new byte[64];
Random.Shared.NextBytes(optionalEntropy);

// To protect:
byte[] encryptedData = ProtectedData.Protect(
    originalData,
    optionalEntropy,
    DataProtectionScope.CurrentUser);

// To unprotect:
byte[] decryptedData = ProtectedData.Unprotect(
    encryptedData,
    optionalEntropy,
    DataProtectionScope.CurrentUser);

Main Types

The main type provided by this library is:

  • System.Security.Cryptography.ProtectedData

Additional Documentation

Feedback & Contributing

System.Security.Cryptography.ProtectedData is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.Security.Cryptography.ProtectedData.

Packages Downloads
Azure.Identity
This is the implementation of the Azure SDK Client Library for Azure Identity
92
Azure.Identity
This is the implementation of the Azure SDK Client Library for Azure Identity
89
Azure.Identity
This is the implementation of the Azure SDK Client Library for Azure Identity
86
Azure.Identity
This is the implementation of the Azure SDK Client Library for Azure Identity
85
Azure.Identity
This is the implementation of the Azure SDK Client Library for Azure Identity
84
Azure.Identity
This is the implementation of the Azure SDK Client Library for Azure Identity
83
Azure.Identity
This is the implementation of the Azure SDK Client Library for Azure Identity
82

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

  • No dependencies.

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET 10.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
11.0.0-preview.7.26381.103 2 08/14/2026
11.0.0-preview.6.26359.118 10 07/16/2026
11.0.0-preview.5.26302.115 15 06/12/2026
11.0.0-preview.4.26230.115 22 05/13/2026
11.0.0-preview.3.26207.106 32 04/16/2026
11.0.0-preview.2.26159.112 32 03/12/2026
11.0.0-preview.1.26104.118 41 02/13/2026
10.0.11 2 08/16/2026
10.0.10 6 07/16/2026
10.0.9 16 06/12/2026
10.0.8 26 05/13/2026
10.0.7 27 04/23/2026
10.0.6 25 04/16/2026
10.0.5 30 03/13/2026
10.0.4 27 03/12/2026
10.0.3 33 02/13/2026
10.0.2 42 01/15/2026
10.0.1 42 12/12/2025
10.0.0 48 11/13/2025
10.0.0-rc.2.25502.107 57 10/17/2025
10.0.0-rc.1.25451.107 61 09/18/2025
10.0.0-preview.7.25380.108 61 09/05/2025
10.0.0-preview.6.25358.103 66 09/05/2025
10.0.0-preview.5.25277.114 65 09/05/2025
10.0.0-preview.4.25258.110 67 09/05/2025
10.0.0-preview.3.25171.5 67 09/05/2025
10.0.0-preview.2.25163.2 66 09/05/2025
10.0.0-preview.1.25080.5 65 09/05/2025
9.0.19 2 08/16/2026
9.0.18 7 07/16/2026
9.0.17 19 06/12/2026
9.0.16 23 05/13/2026
9.0.15 26 04/16/2026
9.0.14 30 03/12/2026
9.0.13 31 02/13/2026
9.0.12 41 01/16/2026
9.0.11 43 11/13/2025
9.0.10 49 10/18/2025
9.0.9 54 09/19/2025
9.0.8 56 09/05/2025
9.0.7 56 09/05/2025
9.0.6 54 09/05/2025
9.0.5 58 09/05/2025
9.0.4 56 09/05/2025
9.0.3 58 09/05/2025
9.0.2 56 09/05/2025
9.0.1 52 09/05/2025
9.0.0 58 09/05/2025
9.0.0-rc.2.24473.5 61 09/05/2025
9.0.0-rc.1.24431.7 68 09/05/2025
9.0.0-preview.7.24405.7 63 09/05/2025
9.0.0-preview.6.24327.7 77 09/05/2025
9.0.0-preview.5.24306.7 65 09/05/2025
9.0.0-preview.4.24266.19 60 09/05/2025
9.0.0-preview.3.24172.9 69 09/05/2025
9.0.0-preview.2.24128.5 64 09/05/2025
9.0.0-preview.1.24080.9 62 09/05/2025
8.0.0 55 09/05/2025
8.0.0-rc.2.23479.6 67 09/05/2025
8.0.0-rc.1.23419.4 58 09/05/2025
8.0.0-preview.7.23375.6 64 09/05/2025
8.0.0-preview.6.23329.7 72 09/05/2025
8.0.0-preview.5.23280.8 62 09/05/2025
8.0.0-preview.4.23259.5 64 09/05/2025
8.0.0-preview.3.23174.8 68 09/05/2025
8.0.0-preview.2.23128.3 58 09/05/2025
8.0.0-preview.1.23110.8 61 09/05/2025
7.0.1 55 09/05/2025
7.0.0 57 09/05/2025
7.0.0-rc.2.22472.3 68 09/05/2025
7.0.0-rc.1.22426.10 64 09/05/2025
7.0.0-preview.7.22375.6 60 09/05/2025
7.0.0-preview.6.22324.4 60 09/05/2025
7.0.0-preview.5.22301.12 62 09/05/2025
7.0.0-preview.4.22229.4 60 09/05/2025
7.0.0-preview.3.22175.4 65 09/05/2025
7.0.0-preview.2.22152.2 68 09/05/2025
7.0.0-preview.1.22076.8 58 09/05/2025
6.0.0 57 09/05/2025
6.0.0-rc.2.21480.5 60 09/05/2025
6.0.0-rc.1.21451.13 64 09/05/2025
6.0.0-preview.7.21377.19 69 09/05/2025
6.0.0-preview.6.21352.12 62 09/05/2025
6.0.0-preview.5.21301.5 64 09/05/2025
6.0.0-preview.4.21253.7 64 09/05/2025
6.0.0-preview.3.21201.4 61 09/05/2025
6.0.0-preview.2.21154.6 68 09/05/2025
6.0.0-preview.1.21102.12 66 09/05/2025
5.0.0 59 09/05/2025
5.0.0-rc.2.20475.5 62 09/05/2025
5.0.0-rc.1.20451.14 63 09/05/2025
5.0.0-preview.8.20407.11 63 09/05/2025
5.0.0-preview.7.20364.11 60 09/05/2025
5.0.0-preview.6.20305.6 60 09/05/2025
5.0.0-preview.5.20278.1 61 09/05/2025
5.0.0-preview.4.20251.6 60 09/05/2025
5.0.0-preview.3.20214.6 63 09/05/2025
5.0.0-preview.2.20160.6 61 09/05/2025
5.0.0-preview.1.20120.5 68 09/05/2025
4.7.0 52 09/05/2025
4.7.0-preview3.19551.4 71 09/05/2025
4.7.0-preview2.19523.17 62 09/05/2025
4.7.0-preview1.19504.10 69 09/05/2025
4.6.0 56 09/05/2025
4.6.0-rc1.19456.4 70 09/05/2025
4.6.0-preview9.19421.4 66 09/05/2025
4.6.0-preview9.19416.11 65 09/05/2025
4.6.0-preview8.19405.3 58 09/05/2025
4.6.0-preview7.19362.9 67 09/05/2025
4.6.0-preview6.19303.8 62 09/05/2025
4.6.0-preview6.19264.9 66 09/05/2025
4.6.0-preview5.19224.8 62 09/05/2025
4.6.0-preview4.19212.13 73 09/05/2025
4.6.0-preview3.19128.7 69 09/05/2025
4.6.0-preview.19073.11 71 09/05/2025
4.6.0-preview.18571.3 63 09/05/2025
4.5.0 56 09/05/2025
4.5.0-rc1 53 09/05/2025
4.5.0-preview2-26406-04 66 09/05/2025
4.5.0-preview1-26216-02 60 09/05/2025
4.5.0-preview1-25914-04 67 09/05/2025
4.4.0 58 09/05/2025
4.4.0-preview2-25405-01 59 09/05/2025
4.4.0-preview1-25305-02 69 09/05/2025
4.3.0 59 09/05/2025
4.3.0-preview1-24530-04 65 09/05/2025
4.0.0 57 09/05/2025