DSA – Digital Signature Algorithm

Interactive demo: manual DSA math in the browser + Web Crypto ECDSA

Key generation

Generates a DSA key pair with parameters p, q, α and private key d. Educational small primes (p ≈ 20,000–100,000) — not secure.

Sign a message

Sign a message with the generated private key. The signature is a pair (r, s).

Verify a signature

Verify a signature with the public key.

Key generation (Web Crypto ECDSA P-256)

Generates an ECDSA P-256 key pair via the Web Crypto API. Keys are shown as JWK JSON (not PEM DSA).

Sign (Web Crypto ECDSA)

Sign with the ECDSA P-256 private key. The signature is a raw (r‖s) hex string.

Verify (Web Crypto ECDSA)

Verify with the ECDSA P-256 public key kept in this tab.

Implementation comparison

Characteristic Manual DSA (JS BigInt) Web Crypto ECDSA P-256
Algorithm DSA over a finite field (SHA-256) ECDSA on NIST P-256 (SHA-256)
Key size Small primes (not secure) 256-bit elliptic curve (production-grade)
Performance Slower (pure JS, trial-division primes) Fast (native browser crypto)
Security Educational only Production-ready
Key format Raw numbers (p, q, α, β, d) JWK (JSON Web Key)
Use case Understand the algorithm Real applications

Performance test

Times a full keygen + sign + verify cycle for both implementations (real wall-clock, not simulated).