https://github.com/timothymeadows/curve25519.netcore
An elliptic curve offering 128 bits of security and designed for use with the elliptic curve Diffie–Hellman (ECDH) key agreement scheme.
https://github.com/timothymeadows/curve25519.netcore
Last synced: about 1 year ago
JSON representation
An elliptic curve offering 128 bits of security and designed for use with the elliptic curve Diffie–Hellman (ECDH) key agreement scheme.
- Host: GitHub
- URL: https://github.com/timothymeadows/curve25519.netcore
- Owner: TimothyMeadows
- License: mit
- Created: 2020-08-29T00:35:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-21T21:54:33.000Z (almost 4 years ago)
- Last Synced: 2025-03-29T04:49:13.728Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Curve25519.NetCore
[](https://opensource.org/licenses/MIT) [](https://www.nuget.org/packages/Curve25519.NetCore/)
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](https://github.com/TimothyMeadows/SecureRandom.NetCore)
# Install
From a command prompt
```bash
dotnet add package Curve25519.NetCore
```
```bash
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.
```csharp
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);
```