![]() |
VOOZH | about |
dotnet add package EngineBay.DataProtection --version 2.0.3
NuGet\Install-Package EngineBay.DataProtection -Version 2.0.3
<PackageReference Include="EngineBay.DataProtection" Version="2.0.3" />
<PackageVersion Include="EngineBay.DataProtection" Version="2.0.3" />Directory.Packages.props
<PackageReference Include="EngineBay.DataProtection" />Project file
paket add EngineBay.DataProtection --version 2.0.3
#r "nuget: EngineBay.DataProtection, 2.0.3"
#:package EngineBay.DataProtection@2.0.3
#addin nuget:?package=EngineBay.DataProtection&version=2.0.3Install as a Cake Addin
#tool nuget:?package=EngineBay.DataProtection&version=2.0.3Install as a Cake Tool
👁 NuGet version
👁 Maintainability
👁 Test Coverage
DataProtection module for EngineBay published to EngineBay.DataProtection on NuGet.
Registering and configuring this module will add a DataProtectionProvider to your service collection, making it available for dependency injection. You can use this provider to encrypt and decrypt text, which is useful when storing sensitive data.
For any fields that you wish to be encrypted while stored in your database, the DataProtectionProvider should be used to encrypt before storing, and decrypt when you wish to access the value. This means that the data protection mechanism is agnostic to which database system you use.
Warning: Whilst this module provides the options to store your encryption keys in a local files system or on a redis server, it cannot back up your keystore. Ensure you have a secure backup strategy. If you lose the keys, you will lose access to the data.
Read more about data protection here.
If the module is registered, accessing it in any other module's class is as simple as normal dependency injection: specify IDataProtectionProvider dataProtectionProvider as a constructor parameter.
To use this, you will need to create a protector and use it to protect or unprotect your desired strings.
To encrypt:
var dataProtector = dataProtectionProvider.CreateProtector("Reason for encrypting");
var encryptedMessage = dataProtector.Protect(message);
To unencrypt:
var dataProtector = dataProtectionProvider.CreateProtector("Reason for encrypting");
var message = dataProtector.Unprotect(encryptedMessage);
For an example of a model with a field that is stored encrypted at rest, see the EncryptedMessage field for SessionLog from EngineBay.ActorEngine.
This module cannot run on its own. You will need to register it in your application to use its functionality. See the Demo API registration guide.
See the Documentation Portal.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on EngineBay.DataProtection:
| Package | Downloads |
|---|---|
|
EngineBay.ActorEngine
Package Description |
This package is not used by any popular GitHub repositories.