ML-DSA Sign & Verify Online | Post-Quantum Signatures (FIPS 204)
Digital Signatures 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 Set | Security Level | Public Key | Secret Key | Signature Size | Best for |
|---|---|---|---|---|---|
| ML-DSA-44 | 128-bit | 1312 bytes | 2560 bytes | 2420 bytes | Bandwidth-constrained, IoT |
| ML-DSA-65 | 192-bit | 1952 bytes | 4032 bytes | 3309 bytes | General-purpose (recommended) |
| ML-DSA-87 | 256-bit | 2592 bytes | 4896 bytes | 4627 bytes | Top-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
Security Notes
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
- FIPS 204 — Module-Lattice-Based Digital Signature Standard
- CRYSTALS-Dilithium — Official Website
- Post-Quantum Cryptography Research
- NIST Post-Quantum Cryptography Standardization
Related Concepts
- ML-KEM Key Encapsulation — Post-quantum key agreement (FIPS 203)
- Ed25519 Sign/Verify — Classical EdDSA signatures (faster, smaller)
- Digital Signature Verify — RSA and ECDSA signatures
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
Digital Signature & Verify
Create and verify digital signatures online with RSA (PSS, PKCS#1 v1.5) or ECDSA (P-256, P-384, P-521, secp256k1). Text/hex/Base64 input.
Ed25519 Sign / Verify
Sign and verify with Ed25519 or Ed25519ph (EdDSA) online. PEM and raw hex keys, built-in key pair generator, public key derivation.
JWT Signer & Verifier
Sign, parse, and verify JWT (JSON Web Token) online. HS/RS/PS/ES algorithms, decode header and payload, claims breakdown, expiration checks.