ML-DSA Sign & Verify Online | Post-Quantum Signatures (FIPS 204)

Digital Signatures
100% client-side. Processed locally in your browser using the Web Crypto API. Nothing is sent to any server.
⚠️ Critical Security: ML-DSA is a post-quantum digital signature standard (FIPS 204, August 2024). Signatures are larger than classical ones (2.4–4.6 KB). For production use, integrate through a FIPS 204 validated library. For classical signatures, use Ed25519 or ECDSA.

How It Works

What Is ML-DSA (Post-Quantum Digital Signatures)?

ML-DSA (Module-Lattice-Based Digital Signature Algorithm), standardized as FIPS 204 by NIST in August 2024 (formerly known as CRYSTALS-Dilithium), is a post-quantum digital signature scheme. Its security rests on the Module-LWE (Learning With Errors) problem over module lattices — the same mathematical foundation as ML-KEM. Unlike classical signatures (RSA, ECDSA, Ed25519), ML-DSA is resistant to attacks by quantum computers.

This tool runs the full FIPS 204 workflow in your browser using the @noble/post-quantum library. Generate a key pair for any of the three parameter sets (ML-DSA-44/65/87), sign a message with the secret key, then verify the signature with the public key — all locally, no data leaves your device. Post-quantum keys and signatures are larger than classical ones (1–5 KB), so the tool validates every input against exact FIPS 204 byte lengths.

When to Use ML-DSA

  • Post-quantum document signing — Sign contracts, software releases, or documents with quantum-resistant signatures
  • Long-term authenticity — Protect data that must remain verifiable for decades (government archives, healthcare records)
  • Protocol future-proofing — Any new protocol should consider post-quantum signatures
  • Compliance requirements — NIST FIPS 204 is becoming the standard for federal and regulated industries
  • Hybrid signatures — Combine ML-DSA with classical signatures for defense in depth
  • When NOT to use — For current-only threat models, Ed25519 or ECDSA are faster and produce smaller signatures

Parameter Set Comparison

Parameter SetSecurity LevelPublic KeySecret KeySignature SizeBest for
ML-DSA-44128-bit1312 bytes2560 bytes2420 bytesBandwidth-constrained, IoT
ML-DSA-65192-bit1952 bytes4032 bytes3309 bytesGeneral-purpose (recommended)
ML-DSA-87256-bit2592 bytes4896 bytes4627 bytesTop-secret-grade, maximum security

Standards Compliance

  • FIPS 204 — Module-Lattice-Based Digital Signature Standard (NIST, August 2024)
  • RFC 9180 — Hybrid Public Key Encryption (HPKE) — ML-DSA integration
  • NIST PQC Competition — CRYSTALS-Dilithium selected as the primary signature standard
  • @noble/post-quantum — Audited JavaScript implementation of FIPS 204
  • pqcrystals — Reference implementation in C and Python

Last updated:

Code Examples

Generate ML-DSA key pair and sign in multiple languages:

JavaScript — @noble/post-quantum (Browser)

// ML-DSA-65 sign & verify
import { mldsa65 } from '@noble/post-quantum/ml-dsa.js';

// Generate key pair
const seed = crypto.getRandomValues(new Uint8Array(32));
const { publicKey, secretKey } = mldsa65.keygen(seed);

// Sign
const message = new TextEncoder().encode('message to sign');
const signature = mldsa65.sign(secretKey, message);

// Verify
const isValid = mldsa65.verify(publicKey, message, signature);
console.log('Signature valid:', isValid);
console.log('Public key size:', publicKey.length, 'bytes');  // 1952
console.log('Signature size:', signature.length, 'bytes');   // 3309

Python — pqcrystals

from pqcrystals.ml_dsa.ref.ml_dsa65 import keygen, sign, verify

# Generate key pair
public_key, secret_key = keygen()

# Sign
message = b"message to sign"
signature = sign(secret_key, message)

# Verify
is_valid = verify(public_key, message, signature)
print(f"Signature valid: {is_valid}")

Go — cloudflare/circl

import "github.com/cloudflare/circl/sign/dilithium"

// Generate key pair (Dilithium3 = ML-DSA-65)
pk, sk, _ := dilithium.Mode3.KeyGen()

// Sign
message := []byte("message to sign")
signature := dilithium.Mode3.Sign(sk, message)

// Verify
valid := dilithium.Mode3.Verify(pk, message, signature)

Rust — pqcrypto-dilithium

use pqcrypto_dilithium::dilithium3::*;
use pqcrypto_traits::sign::*;

let (pk, sk) = keypair();
let message = b"message to sign";
let signature = sign(message, &sk);
let valid = verify(&signature, message, &pk);

Node.js — @noble/post-quantum (CommonJS)

const { mldsa65 } = require('@noble/post-quantum/ml-dsa.js');

const seed = require('crypto').randomBytes(32);
const { publicKey, secretKey } = mldsa65.keygen(new Uint8Array(seed));

const message = Buffer.from('message to sign');
const signature = mldsa65.sign(secretKey, message);
const isValid = mldsa65.verify(publicKey, message, signature);
console.log('Signature valid:', isValid);

Common Pitfalls

⚠️ Larger Key and Signature Sizes: ML-DSA-65 uses 1.9 KB public keys and 3.3 KB signatures — much larger than Ed25519 (32 bytes / 64 bytes). Ensure your network and storage can handle the bandwidth.
⚠️ Using Unvalidated Implementations: For production, use FIPS 204 validated implementations. This tool uses @noble/post-quantum which is audited but not yet FIPS-validated.
⚠️ Reusing Signing Keys Across Protocols: Never reuse signing keys across different protocols without a key derivation step. Derive protocol-specific keys with HKDF.
⚠️ Slow Key Generation: ML-DSA key generation involves sampling from lattice distributions, which is computationally heavier than classical ECC. ML-DSA-87 takes noticeably longer than ML-DSA-44.
⚠️ Parameter Set Mismatch: ML-DSA-44, ML-DSA-65, and ML-DSA-87 produce incompatible keys and signatures. Always verify both sides use the same parameter set.

Security Notes

ℹ️ Quantum-Resistant: ML-DSA security rests on Module-LWE lattice problems. Shor's algorithm cannot break it — the best known quantum attacks still cost super-polynomial time.
ℹ️ ML-DSA-65 Is the Default: ML-DSA-65 targets 192-bit security and is the practical default for most applications, balancing key size and security margin.
ℹ️ Randomized Signatures: ML-DSA signing is randomized — signing the same message twice produces different signatures. This is by design and does not affect verification.
ℹ️ Input Validation: This tool validates every input against exact FIPS 204 byte lengths before processing, preventing malformed key or signature errors.

Disclaimer

This tool is provided for educational and development purposes. ML-DSA is a new standard (FIPS 204, August 2024) — implementations should be monitored for updates. For production systems, use FIPS 204 validated libraries and proper key management infrastructure.

Further Reading

Related Concepts

Related Tools

Need classical signatures instead? Try the Ed25519 Sign/Verify tool for fast, compact signatures. For post-quantum key encapsulation, see the ML-KEM Key Encapsulation tool. You can also generate classical key pairs with the RSA Key Generator.

Frequently Asked Questions

Which parameter set should I choose?

ML-DSA-44 targets 128-bit security (comparable to AES-128), ML-DSA-65 targets 192 bits, and ML-DSA-87 targets 256 bits. ML-DSA-65 is the practical default for most applications, balancing key size and security margin. Use ML-DSA-44 where bandwidth is extremely constrained, and ML-DSA-87 for top-secret-grade margins or when you want the largest safety buffer against future lattice algorithm improvements.

Is this tool safe to use for real signatures?

All key generation and signing happens locally in your browser using the audited @noble/post-quantum library — no key material ever leaves your device. However, this tool is designed for education, prototyping, and verification. For production use, integrate ML-DSA through a FIPS 204 validated library and proper key management infrastructure. Never reuse signing keys across different protocols without a key derivation step.

What input formats are supported for keys and messages?

Keys and signatures accept both hexadecimal and Base64 encoding — the tool auto-detects which one you paste. Messages can be entered as plain text, hex bytes, or Base64 binary data. Select the input format before signing to ensure the tool hashes the exact bytes you intend.

How do I verify a signature from another tool?

Paste the signer's public key, the original message (in the same format used for signing), and the signature. The tool validates all inputs against exact FIPS 204 byte lengths before verification. If verification fails, check that the parameter set (44/65/87) matches what was used to sign, and that the message encoding is identical.

What should I do if key generation is slow?

ML-DSA key generation involves sampling from lattice distributions, which is computationally heavier than classical ECC. ML-DSA-87 takes noticeably longer than ML-DSA-44. If you experience delays, ensure your browser is up to date — modern JavaScript engines optimize the polynomial arithmetic. For batch key generation, consider using a native library instead of the browser.

Privacy: This tool runs entirely in your browser — nothing is uploaded or stored. · Disclaimer: For educational purposes only. Not professional security advice.

More in Signatures

Learn More