Skip to content

An elliptic curve offering 128 bits of security and designed for use with the elliptic curve Diffie–Hellman (ECDH) key agreement scheme.

License

Notifications You must be signed in to change notification settings

TimothyMeadows/Curve25519.NetCore

Repository files navigation

Curve25519.NetCore

License: MIT nuget

An elliptic curve offering 128 bits of security and designed for use with the elliptic curve Diffie–Hellman (ECDH) key agreement scheme. It is one of the fastest ECC curves and is not covered by any known patents. Depends on SecureRandom.NetCore

Install

From a command prompt

dotnet add package Curve25519.NetCore
Install-Package Curve25519.NetCore

You can also search for package via your nuget ui / website:

https://www.nuget.org/packages/Curve25519.NetCore/

Examples

You can find more examples in the github examples project.

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);

About

An elliptic curve offering 128 bits of security and designed for use with the elliptic curve Diffie–Hellman (ECDH) key agreement scheme.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages