An elliptic curve offering 128 bits of security and designed for use with the elliptic curve Diffie–Hellman (ECDH) key agreement scheme.
The goal of this library is to provide a NuGet package targeting .NET Standard 2.0 that is compatible with Blazor WebAssembly.
dotnet add package Whyvra.Crypto.X25519
var curve25519 = new Curve25519();
var alicePrivate = curve25519.CreateRandomPrivateKey();
var alicePublic = curve25519.GetPublicKey(alicePrivate);
var bobPrivate = curve25519.CreateRandomPrivateKey();
var bobPublic = curve25519.GetPublicKey(bobPrivate);
var aliceShared = curve25519.GetSharedSecret(alicePrivate, bobPublic);
var bobShared = curve25519.GetSharedSecret(bobPrivate, alicePublic);
var equal = aliceShared.SequenceEqual(bobShared);
This library is based on work by Timothy Meadows and Michael Heyman and their respective libraries linked below.
https://github.com/TimothyMeadows/Curve25519.NetCore https://github.com/mheyman/Isopoh.Cryptography.Argon2
Curve25519 was designed by Daniel J. Bernstein.
All credit for work go to the original authors.
Released under the MIT License.