class NaCl::Signatures::Ed25519::SigningKey

Overview

Private key for producing digital signatures using the Ed25519 algorithm. Ed25519 provides a 128-bit security level, that is to say, all known attacks take at least 2^128 operations, providing the same security level as AES-128, NIST P-256, and RSA-3072.

Signing keys are produced from a 32-byte (256-bit) random seed value. This value can be passed into the SigningKey constructor as a String whose bytesize is 32.

The public VerifyKey can be computed from the private 32-byte seed value as well, eliminating the need to store a "keypair".

SigningKey produces 64-byte (512-bit) signatures. The signatures are deterministic: signing the same message will always produce the same signature. This prevents "entropy failure" seen in other signature algorithms like DSA and ECDSA, where poor random number generators can leak enough information to recover the private key.

Included Modules

Defined in:

nacl/signatures/ed25519/signing_key.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module NaCl::Serializable

inspect inspect, to_s to_s

Instance methods inherited from module NaCl::KeyComparator

<=>(other) <=>, ==(other) ==, compare32(other) compare32

Constructor Detail

def self.new(seed : Slice(UInt8)) #

Create a SigningKey from a seed value


[View source]

Class Method Detail

def self.generate #

Generate a random SigningKey


[View source]
def self.signature_bytes #

The size of signatures generated by the SigningKey class


[View source]

Instance Method Detail

def bytes : Slice(UInt8) #

Return the raw seed value of this key


[View source]
def keypair_bytes : Slice(UInt8) #

Return the raw 64 byte value of this key


[View source]
def sign(message) #

Sign a message using this key


[View source]
def signature_bytes #

The size of signatures generated by the SigningKey instance


[View source]
def verify_key : VerifyKey #

[View source]