DKNet.Svc.Encryption 10.1.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package DKNet.Svc.Encryption --version 10.1.8
                    
NuGet\Install-Package DKNet.Svc.Encryption -Version 10.1.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DKNet.Svc.Encryption" Version="10.1.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DKNet.Svc.Encryption" Version="10.1.8" />
                    
Directory.Packages.props
<PackageReference Include="DKNet.Svc.Encryption" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DKNet.Svc.Encryption --version 10.1.8
                    
#r "nuget: DKNet.Svc.Encryption, 10.1.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DKNet.Svc.Encryption@10.1.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DKNet.Svc.Encryption&version=10.1.8
                    
Install as a Cake Addin
#tool nuget:?package=DKNet.Svc.Encryption&version=10.1.8
                    
Install as a Cake Tool

DKNet.Svc.Encryption

NuGet NuGet Downloads .NET License

Standalone, explicitly-invoked cryptography toolkit: AES-GCM encryption, RSA encrypt/sign, HMAC and SHA hashing, and Base64/Base64URL helpers, all operating on UTF-8 strings. For transparent EF Core column encryption instead, see DKNet.EfCore.Encryption — a different package.

Features

  • IAesGcmEncryption — authenticated AES-256-GCM encryption with optional associated data
  • IRsaEncryption — RSA encrypt/decrypt (OAEP-SHA256) and sign/verify (PKCS1-SHA256), including public-key-only instances
  • IHmacHashing / IShaHashing — HMAC-SHA256/512 and SHA-256/512 compute + constant-time verify
  • Base64StringExtensions — Base64 and Base64URL encode/decode helpers
  • IAesEncryption (AES-CBC) kept for migration only — [Obsolete], prefer AES-GCM

Installation

dotnet add package DKNet.Svc.Encryption

Quick Start

using DKNet.Svc.Encryption;
using DKNet.Svc.Encryption.Ciphers;

builder.Services.AddEncryptionServices(); // AES-GCM, HMAC, SHA (AddRsaEncryption(key) separately if needed)

public sealed class SecretStore(IAesGcmEncryption aesGcm)
{
    public string Protect(string plainText) => aesGcm.EncryptString(plainText);
    public string Reveal(string cipherPackage) => aesGcm.DecryptString(cipherPackage);
}

Migration — namespace changes in this release

Root types were grouped into concern folders; the namespace of each moved type now ends with its folder name. This is an import-only source break: no type was renamed, removed, resignatured, or had its behaviour changed — update the using line and you're done.

Type Old namespace New namespace
IAesEncryption/AesEncryption, IAesGcmEncryption/AesGcmEncryption, IRsaEncryption/RsaEncryption DKNet.Svc.Encryption DKNet.Svc.Encryption.Ciphers
IHmacHashing/HmacHashing, IShaHashing/ShaHashing DKNet.Svc.Encryption DKNet.Svc.Encryption.Hashing

EncryptionSetup (registration point) and Base64StringExtensions/Base65StringExtensions (the Base64/Base64URL encoding helpers) stay at DKNet.Svc.Encryption.

Documentation

Full feature reference, configuration, and gotchas: https://github.com/baoduy/DKNet/blob/dev/docs/Services/DKNet.Svc.Encryption.md

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
12.0.0 3 9/17/2026
11.0.0 20 9/17/2026
10.1.29 33 9/17/2026
10.1.28 31 9/17/2026
10.1.27 36 9/16/2026
10.1.26 37 9/16/2026
10.1.25 39 9/16/2026
10.1.24 83 9/11/2026
10.1.23 82 9/11/2026
10.1.22 79 9/11/2026
10.1.21 90 9/11/2026
10.1.20 92 9/9/2026
10.1.19 212 9/3/2026
10.1.18 85 9/3/2026
10.1.17 88 9/3/2026
10.1.16 99 9/3/2026
10.1.15 138 9/1/2026
10.1.14 84 9/1/2026
10.1.13 91 8/31/2026
10.1.8 90 8/21/2026
Loading failed