nebulae.dotX25519
0.1.0
dotnet add package nebulae.dotX25519 --version 0.1.0
NuGet\Install-Package nebulae.dotX25519 -Version 0.1.0
<PackageReference Include="nebulae.dotX25519" Version="0.1.0" />
<PackageVersion Include="nebulae.dotX25519" Version="0.1.0" />
<PackageReference Include="nebulae.dotX25519" />
paket add nebulae.dotX25519 --version 0.1.0
#r "nuget: nebulae.dotX25519, 0.1.0"
#:package nebulae.dotX25519@0.1.0
#addin nuget:?package=nebulae.dotX25519&version=0.1.0
#tool nuget:?package=nebulae.dotX25519&version=0.1.0
dotX25519
A high-performance, minimal, cross-platform wrapper around BoringSSL's X25519 key exchange implementation (RFC 7748).
The native backend is compiled directly from BoringSSL's curve25519 and related modules - ensuring constant-time cryptographic operations and production-grade optimizations across Windows, Linux, and macOS.
Tests are included and available in the Github repo.
Features
- Cross-platform: Works on Windows, Linux, and macOS (x64 & Apple Silicon).
- High performance: Optimized for speed, leveraging native SIMD-enabled code.
- Easy to use: Simple API for key exchange.
- Secure: Uses Google's BoringSSL implementation, which is widely trusted in the industry.
- Minimal dependencies: No external dependencies required (all are included), making it lightweight and easy to integrate.
Requirements
- .NET 8.0 or later
- Windows x64, Linux x64, or macOS (x64 & Apple Silicon)
Usage
using System;
using nebulae.dotX25519;
class Example
{
static void Main()
{
Span<byte> alicePriv = stackalloc byte[32];
Span<byte> bobPriv = stackalloc byte[32];
Span<byte> alicePub = stackalloc byte[32];
Span<byte> bobPub = stackalloc byte[32];
Span<byte> sharedA = stackalloc byte[32];
Span<byte> sharedB = stackalloc byte[32];
// Generate two random private keys (e.g., from a CSPRNG)
RandomNumberGenerator.Fill(alicePriv);
RandomNumberGenerator.Fill(bobPriv);
// Clamp per RFC 7748
X25519.ClampPrivateKey(alicePriv);
X25519.ClampPrivateKey(bobPriv);
// Derive public keys
X25519.DerivePublicKey(alicePriv, alicePub);
X25519.DerivePublicKey(bobPriv, bobPub);
// Derive shared secrets
X25519.DeriveSharedSecret(alicePriv, bobPub, sharedA);
X25519.DeriveSharedSecret(bobPriv, alicePub, sharedB);
Console.WriteLine(sharedA.SequenceEqual(sharedB)
? "Shared secret matches"
: "Mismatch!");
}
}
Installation
You can install the package via NuGet:
$ dotnet add package nebulae.dotX25519
Or via git:
$ git clone https://github.com/nebulaeonline/dotX25519.git
$ cd dotEd25519
$ dotnet build
License
MIT
Roadmap
Unless there are vulnerabilities found, there are no plans to add any new features.
Product | Versions 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 was computed. 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. |
-
net8.0
- No dependencies.
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 |
---|---|---|
0.1.0 | 232 | 8/6/2025 |