Soenneker.Encryption.AesGcm 4.0.8

Prefix Reserved
dotnet add package Soenneker.Encryption.AesGcm --version 4.0.8
                    
NuGet\Install-Package Soenneker.Encryption.AesGcm -Version 4.0.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="Soenneker.Encryption.AesGcm" Version="4.0.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Encryption.AesGcm" Version="4.0.8" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Encryption.AesGcm" />
                    
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 Soenneker.Encryption.AesGcm --version 4.0.8
                    
#r "nuget: Soenneker.Encryption.AesGcm, 4.0.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 Soenneker.Encryption.AesGcm@4.0.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=Soenneker.Encryption.AesGcm&version=4.0.8
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Encryption.AesGcm&version=4.0.8
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Encryption.AesGcm

A .NET utility wrapping AES-GCM BCL for symmetric encryption.

Installation

dotnet add package Soenneker.Encryption.AesGcm

Usage

using Soenneker.Encryption.AesGcm;

string encrypted = AesGcmUtil.Encrypt("super-secret-webhook-token", "configured-key-material");
string decrypted = AesGcmUtil.Decrypt(encrypted, "configured-key-material");

The default string payload format is:

v1:<base64 nonce>:<base64 ciphertext>:<base64 tag>

For authenticated context binding, pass associated data during both encryption and decryption:

string encrypted = AesGcmUtil.Encrypt(secret, key, associatedData: "business-1:generic-webhook");
string decrypted = AesGcmUtil.Decrypt(encrypted, key, associatedData: "business-1:generic-webhook");

Key material can be a base64 encoded 128-bit, 192-bit, or 256-bit AES key. Other key material is hashed with SHA-256 into a 256-bit AES key.

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
4.0.8 72 7/17/2026
4.0.7 45 7/17/2026
4.0.6 58 7/16/2026
4.0.5 50 7/16/2026
4.0.4 62 7/15/2026
4.0.3 187 7/8/2026
4.0.1 237 6/19/2026