Ed25519Signer.NET 34.0.0.8

dotnet add package Ed25519Signer.NET --version 34.0.0.8                
NuGet\Install-Package Ed25519Signer.NET -Version 34.0.0.8                
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="Ed25519Signer.NET" Version="34.0.0.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ed25519Signer.NET --version 34.0.0.8                
#r "nuget: Ed25519Signer.NET, 34.0.0.8"                
#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.
// Install Ed25519Signer.NET as a Cake Addin
#addin nuget:?package=Ed25519Signer.NET&version=34.0.0.8

// Install Ed25519Signer.NET as a Cake Tool
#tool nuget:?package=Ed25519Signer.NET&version=34.0.0.8                

alternate text is missing from this package README image alternate text is missing from this package README image

Sign and Verify data using Ed25519 from RFC8032

Simple Usage

The easiest way to use Ed25519Signer.NET is by creating a Ed25519SignerService and/or Ed25519VerifierService

Sign

You can reuse this service to sign multiple pieces of data

Ed25519SignerService signer = new("private.pem", 2048);

byte[] signature = signer.Sign(new byte[64]);

Verify

You can reuse this service to verify multiple pieces of data

Ed25519VerifierService verifier = new("public3.txt", 2048);

bool success = verifier.Verify(signature, new byte[64]);

Generate Keys

This library can not generate new Private Keys

An easy way to generate keys is using Git Bash which can be downloaded Here

alternate text is missing from this package README image

// Generate Private Key
openssl genpkey -algorithm ed25519 -out "C:\private.pem"
// Generate Public Key from the Private Key
openssl pkey -in "C:\private.pem" -pubout -out "C:\public.pem"

Advanced Usage

If you don't want to use either of the Services you can do everything manually.

Load Key from PEM File

Ed25519KeyDataReader privateKeyData = new Ed25519KeyDataReader("C:\\Keys\\private.pem");

Ed25519PrivateKey privatekey = Ed25519KeyFactory.CreatePrivateKey(privateKeyData.Read());

Load Key from Text File

Ed25519KeyDataReader privateKeyData = new Ed25519KeyDataReader("..\\..\\private3.txt", true);

Ed25519PrivateKey privatekey = Ed25519KeyFactory.CreatePrivateKey(privateKeyData.ReadFromTextFast());            

Load Key from .ED25519 File

Ed25519FileReader privateKeyData = new Ed25519FileReader("..\\..\\private.ED25519");

Ed25519PrivateKey privatekey = Ed25519KeyFactory.CreatePrivateKey(privateKeyData.ReadEd25519Fast());

Signing Data

Create a single use Signer

Ed25519Signer signer = new Ed25519Signer();

signer.Init(privatekey);

signer.BlockUpdate(new byte[32] /* data to sign */, 0 /* offset */, 32 /* data length*/);

byte[] output = signer.GenerateSignature();

signer.Reset();

Verifying Data

Create a single use Verifier

Ed25519Verifier verify = new Ed25519Verifier();

verify.Init(publicKey);

verify.BlockUpdate(new byte[32] /* same data to verify */, 0 /* offset */, 32 /* data length*/);

bool v = verify.VerifySignature(output);

verify.Reset();

Creating .ED25519 Files

Creates a .ED25519 file which has the key on the first line

new Ed25519KeyDataWriter("private.pem", "private.ED25519", true);

Copyright S Christison �2023-2024

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.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
34.0.0.8 2,891,866 6/11/2024

Add Ed25519SignerService
Add Ed25519VerifierService

Change default namespace to Ed25519DataSignerVerifier

Tweak namepsaces so Ed25519SignerService and Ed25519VerifierService appear first

Move most existing classes for more advanced usage to Ed25519DataSignerVerifier.Advanced

Ed25519SignerService maintains an internal list of Single use Ed25519Signers so they can be reused without creating new ones
Ed25519VerifierService maintains an internal list of Single use Ed25519Verifiers so they can be reused without creating new ones