A compact and lightweight library for SLH-DSA (Stateless Hash-Based Digital Signature Algorithm), a post-quantum cryptographic standard providing robust security against classical and quantum attacks. SLH-DSA uses hash-based cryptography to ensure secure key generation, message signing, and signature verification.
- Generate SLH-DSA key pairs.
- Sign and verify messages.
- Supports multiple parameter sets (e.g., SHAKE-128F, SHA2-128F).
- Thread-safe supporting concurrency.
- Tests included.
dotnet add package Soenneker.Hashing.Slhdsa
(string privateKey, string publicKey) = SlhDsaHashingUtil.GenerateKeyPair(); // Keys are Base64 strings
string signature = SlhDsaHashingUtil.SignMessage("Hello, SLH-DSA!", privateKey); // Signaure is a Base64 string
bool isValid = SlhDsaHashingUtil.VerifySignature("Hello, SLH-DSA!", signature, publicKey);
var parameterSet = SlhDsaParameterType.SLH_DSA_SHAKE_128F;
(string privateKey, string publicKey) = SlhDsaHashingUtil.GenerateKeyPair(parameterSet);
string signature = SlhDsaHashingUtil.SignMessage("Hello, SLH-DSA!", privateKey, parameterSet);
bool isValid = SlhDsaHashingUtil.VerifySignature("Hello, SLH-DSA!", signature, publicKey, parameterSet);