PostQuantum.FileEncryption.Extensions.DependencyInjection 1.1.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.1.0
                    
NuGet\Install-Package PostQuantum.FileEncryption.Extensions.DependencyInjection -Version 1.1.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.1.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.1.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.1.0
                    
#r "nuget: PostQuantum.FileEncryption.Extensions.DependencyInjection, 1.1.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.1.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.1.0
                    
Install as a Cake Addin
#tool nuget:?package=PostQuantum.FileEncryption.Extensions.DependencyInjection&version=1.1.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();

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 and PostQuantum.FileEncryption.Hybrid at its own version.

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

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
1.4.1 938 6/13/2026
1.4.0 929 6/13/2026
1.3.0 1,046 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.1.0 — first published release of the dependency-injection extensions, packaged from the same source tree, release workflow, and supply-chain pipeline as PostQuantum.FileEncryption 1.1.0 and tracking it in lockstep. The .pqfe v2 container format is FROZEN for the 1.x line.