Skip to main content

DSA Key Generator

Free online DSA key generator: generate DSA key pairs in your browser with pure JavaScript BigInt cryptography. Pick FIPS 186-4 domain parameters (1024/160, 2048/224, 2048/256), export OpenSSL-compatible DSA private key and DSA public key PEM files, and test DSA signatures with RFC 6979 deterministic signing. No install, no sign-up, 100% client-side.

⚠ DSA is deprecated for new systems (FIPS 186-5 removed it) — this DSA key pair generator is for testing, legacy interop, and learning. For new projects use Ed25519 or ECDSA.

1 — Generate DSA key pair

How this DSA key generator works

A DSA key pair starts from domain parameters: a large prime p (L bits), a prime divisor q of p−1 (N bits), and a generator g of the subgroup of order q. Key generation itself is then trivial: pick a random secret x in [1, q−1] and compute the public key y = gx mod p. The expensive part is finding p and q — this tool uses the Miller-Rabin primality test (the same family of test OpenSSL uses) with fresh entropy from crypto.getRandomValues.

What you get from this free DSA key generator online

  • DSA parameter generator: generate DSA parameters online — fresh p, q, g via Miller-Rabin, or instant built-in FIPS 186-4 sets.
  • DSA private key generator + DSA public key generator: secret x and public y = gx mod p, with the math re-verified in your browser.
  • DSA PEM generator: download OpenSSL-compatible DSA PRIVATE KEY and PUBLIC KEY PEM files.
  • DSA signature lab: sign messages with deterministic RFC 6979 k and verify the (r, s) signature — the complete workflow to generate DSA keys online with zero server contact.

Supports legacy DSA 1024 (1024/160) through DSA 2048 (2048/224 and 2048/256) FIPS 186-4 pairs. Remember: DSA is deprecated for new cryptography — FIPS 186-5 removed it — so treat every key from any DSA key generator online free tool as a test key, never a production secret.

FIPS 186-4 (L, N) parameter pairs supported
L (p bits)N (q bits)StatusGenerate fresh in-browser
1024160Legacy only~1 second
2048224FIPS 186-4 approved*tens of seconds
2048256FIPS 186-4 approved*tens of seconds

*Approved by FIPS 186-4, but DSA itself was removed from FIPS 186-5 (2023) — approved ≠ recommended for new systems.

DSA vs ECDSA vs RSA

DSA (this tool)ECDSARSA
Math basisDiscrete log, modular arithmeticDiscrete log, elliptic curvesInteger factorization
Key size for ~112-bit security2048-bit p224-bit curve2048-bit modulus
Signatures only?YesYesNo (also encryption)
FIPS 186-5 statusRemovedApprovedApproved
Use for new systems?No — testing/legacy onlyYesYes

OpenSSL command equivalents

Prefer the terminal? These OpenSSL commands do the same job. PEM files downloaded from this page are directly readable by OpenSSL:

openssl dsaparam -out dsa.pem 2048        # domain parameters p, q, g
openssl gendsa -out dsa-key.pem dsa.pem   # DSA private key (x + params)
openssl dsa -in dsa-key.pem -pubout -out dsa-pub.pem   # DSA public key (y)
openssl dgst -sha256 -sign dsa-key.pem -out sig.bin file.txt
openssl dgst -sha256 -verify dsa-pub.pem -signature sig.bin file.txt
Security note: never paste a real production private key into any website — including this one. Generate test keys here, keep production keys on hardware you control.

Frequently asked questions

What is a DSA key generator?
A DSA key generator creates a Digital Signature Algorithm key pair: domain parameters (p, q, g) plus a private key x and a public key y = g^x mod p. This free online DSA key generator runs entirely in your browser using pure JavaScript BigInt math — Web Crypto does not support DSA, so every step (primality testing, key math, signing) is implemented and verifiable here.
How do I generate a DSA key pair in my browser?
Pick a key size (1024/160, 2048/224, or 2048/256), choose instant built-in FIPS 186-4 domain parameters or generate fresh ones with the Miller-Rabin primality test, then click Generate DSA Key Pair. You get the private key (x), public key (y), OpenSSL-compatible PEM blocks, and hex exports — no install, no sign-up.
Is DSA still secure? Should I use it for new systems?
No — DSA is deprecated for new deployments. FIPS 186-5 (2023) removed DSA entirely, and 1024-bit DSA is legacy-only. Use this DSA key pair generator for testing, legacy interop, protocol experiments, and learning. For anything new, generate Ed25519 or ECDSA keys instead (see our ECDSA key generator).
What are the DSA parameters p, q, and g?
p is a large prime (L bits), q is a prime divisor of p-1 (N bits), and g is a generator of the subgroup of order q. FIPS 186-4 defines the (L,N) pairs (1024,160), (2048,224), (2048,256), and (3072,256). All three supported pairs here are available as built-in verified parameters or freshly generated in your browser.
What is the difference between DSA and ECDSA?
Both are digital-signature algorithms, but DSA works over modular integer arithmetic while ECDSA works over elliptic curves — so ECDSA reaches the same security level with far smaller keys (a 256-bit ECDSA key beats 3072-bit DSA). DSA is also removed from FIPS 186-5 while ECDSA remains approved. Try our ECDSA key generator for the modern alternative.
What are the OpenSSL equivalents of this tool?
openssl dsaparam -out dsa.pem 2048 (parameters), openssl gendsa -out dsa-key.pem dsa.pem (key pair), openssl dsa -in dsa-key.pem -pubout -out dsa-pub.pem (public key), openssl dgst -sha256 -sign dsa-key.pem -out sig.bin file (sign), openssl dgst -sha256 -verify dsa-pub.pem -signature sig.bin file (verify). PEM files from this page parse directly in OpenSSL.
Are my generated private keys sent to a server?
Never. Key generation, the Miller-Rabin primality test, RFC 6979 signing, and verification all run locally in your browser tab with crypto.getRandomValues as the entropy source. This page makes zero network requests for its crypto — you can even disconnect from the internet after it loads.
Why does signing use RFC 6979 deterministic k?
Classic DSA picked a random k per signature, and reusing or leaking k exposes the private key (the famous Sony PS3 failure). RFC 6979 derives k deterministically from the private key and message hash, so signatures are reproducible and immune to bad-RNG catastrophes. This tool signs with RFC 6979/HMAC-SHA256 and verifies every signature it produces.

Free tool by NRTechStudio