NTDLS.SecureKeyExchange
3.0.3
dotnet add package NTDLS.SecureKeyExchange --version 3.0.3
NuGet\Install-Package NTDLS.SecureKeyExchange -Version 3.0.3
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="NTDLS.SecureKeyExchange" Version="3.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NTDLS.SecureKeyExchange" Version="3.0.3" />
<PackageReference Include="NTDLS.SecureKeyExchange" />
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 NTDLS.SecureKeyExchange --version 3.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NTDLS.SecureKeyExchange, 3.0.3"
#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 NTDLS.SecureKeyExchange@3.0.3
#: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=NTDLS.SecureKeyExchange&version=3.0.3
#tool nuget:?package=NTDLS.SecureKeyExchange&version=3.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NTDLS.SecureKeyExchange
📦 Be sure to check out the NuGet package: https://www.nuget.org/packages/NTDLS.SecureKeyExchange
Easily generate a single or multi-round Diffie-Hellman key C#.
Scenario (use your imagination):
- localHost is a local service.
- remotePeer is a remote peer.
//localHost starts the process with a call to GenerateNegotiationToken(),
// specifying the size of the key (which is actually n*16).
var localHost = new CompoundNegotiator();
byte[] negotiationToken = localHost.GenerateNegotiationToken(8);
//localHost passes the resulting bytes from GenerateNegotiationToken()
// to a remote peer which passes the bytes to ApplyNegotiationToken().
var remotePeer = new CompoundNegotiator();
byte[] negotiationReply = remotePeer.ApplyNegotiationToken(negotiationToken);
//The remotePeer passes the bytes from ApplyNegotiationToken() back to the
// localHost, where the localHost passes them to ApplyNegotiationResponseToken()
localHost.ApplyNegotiationResponseToken(negotiationReply);
//At this point, both the localHost and the remotePeer have the same bytes in
// "SharedSecret" as we can see from comparing the "SharedSecretHash".
if (remotePeer.SharedSecretHash != localHost.SharedSecretHash)
{
throw new Exception("This should never happen.");
}
Console.WriteLine($"Key length: {localHost.KeyLength} bytes.");
Console.WriteLine($" Local Shared Secret: {localHost.SharedSecretHash}");
Console.WriteLine($"Remote Shared Secret: {remotePeer.SharedSecretHash}");
License
| 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 is compatible. 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.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.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.
Dependency updates and introduced .net 10 support.