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" />
<PackageReference Include="Soenneker.Encryption.AesGcm" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=Soenneker.Encryption.AesGcm&version=4.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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.
-
net10.0
- Soenneker.Extensions.String (>= 4.0.705)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.