PostQuantum.FileEncryption.Extensions.DependencyInjection 1.4.0

There is a newer version of this package available.
See the version list below for details.

Requires NuGet 6.0.0 or higher.

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

PostQuantum.FileEncryption.Extensions.DependencyInjection

Microsoft.Extensions.DependencyInjection integration for PostQuantum.FileEncryption and PostQuantum.FileEncryption.Hybrid. One call registers the encryptor and decryptor services in any host that uses the standard .NET service container — ASP.NET Core, Worker Services, console hosts with Microsoft.Extensions.Hosting.

dotnet add package PostQuantum.FileEncryption.Extensions.DependencyInjection

Usage

Passphrase encryption only (registers PqFileEncryptor + PqFileDecryptor):

builder.Services.AddPqFileEncryption();

Passphrase and X25519 + ML-KEM-768 hybrid recipient encryption (additionally registers PqHybridEncryptor + PqHybridDecryptor):

builder.Services.AddPqHybridFileEncryption();

Detached Ed25519 + ML-DSA-65 signing and verification (registers PqSigner + PqVerifier; key material stays in your own key storage and is passed per call):

builder.Services.AddPqSigning();

Then inject and use:

public sealed class ArchiveService(PqFileEncryptor encryptor, PqFileDecryptor decryptor)
{
    public Task ProtectAsync(string path, string passphrase, CancellationToken ct) =>
        encryptor.EncryptFileAsync(path, path + ".pqfe", passphrase, cancellationToken: ct);
}

Options

Pass a PqEncryptionOptions to tune encryption (KDF choice, work factors, chunk size). Omitting it gives you the library's secure defaults:

builder.Services.AddPqFileEncryption(PqEncryptionOptions.Argon2id);

Options never affect decryption — the decryptor reads every parameter from the authenticated container header, so a service registered with one set of options decrypts files produced with any other.

Behavior

  • Singletons. The encryptor/decryptor types are thread-safe and hold no per-operation state; one instance serves the whole host.
  • TryAdd semantics. If your application already registered its own instance of any of these types, your registration wins.
  • Lockstep versioning. This package always pins PostQuantum.FileEncryption, PostQuantum.FileEncryption.Hybrid, and PostQuantum.FileEncryption.Signing at its own version.

To God be the glory — 1 Corinthians 10:31.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
1.4.1 938 6/13/2026
1.4.0 929 6/13/2026
1.3.0 1,019 6/13/2026
1.2.1 936 6/12/2026
1.2.0 969 6/12/2026
1.1.0 965 6/10/2026

1.4.0 — tracks PostQuantum.FileEncryption 1.4.0 in lockstep; no API changes. Binary-compatibility validation against the published 1.3.0 baseline is now enabled for this package. The release adds cloud envelope-key providers to the family (PostQuantum.FileEncryption.Aws and PostQuantum.FileEncryption.AzureKeyVault); register the provider instance yourself and pass it per call — key material and cloud clients stay in your composition root. No format change: the .pqfe v2 container format remains FROZEN for the 1.x line. See CHANGELOG.md.