0Pricing
Cryptology Academy · Lesson

DSA & ECDSA Signature Schemes

Compare RSA signatures with DSA and the elliptic-curve variant.

DSA & ECDSA Signature Schemes is a free Cryptology Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cryptology Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Welcome

DSA and ECDSA are alternative signature schemes using discrete logarithm hardness. ECDSA dominates modern systems with smaller keys and faster operations.

DSA Overview

DSA (NIST, 1994) uses a cyclic group of prime order q within Z*p. Key generation: private key x; public key y = g^x mod p. Standard: 2048-bit p, 256-bit q.

DSA Signing Algorithm

1. Generate random nonce k (1 < k < q) 2. r = (g^k mod p) mod q 3. s = k^(-1) × (Hash(M) + x×r) mod q 4. Signature: (r, s)

DSA Verification

1. u1 = Hash(M) × s^(-1) mod q 2. u2 = r × s^(-1) mod q 3. v = (g^u1 × y^u2 mod p) mod q 4. Valid if v == r

DSA Nonce Vulnerability

If the same k is used twice: the two signatures share r. From two (r,s1) and (r,s2) pairs, the private key x is directly computable. This destroyed PS3 (k=1 used every time).

ECDSA Overview

ECDSA is DSA instantiated on an elliptic curve group instead of Z*p. The curve provides equivalent security with much smaller parameters: ECDSA-256 ≈ DSA-3072 in security.

ECDSA in Python

from cryptography.hazmat.primitives.asymmetric import ec from cryptography.hazmat.primitives import hashes private_key = ec.generate_private_key(ec.SECP256R1()) sig = private_key.sign(message, ec.ECDSA(hashes.SHA256())) public_key = private_key.public_key() public_key.verify(sig, message, ec.ECDSA(hashes.SHA256()))

Deterministic ECDSA (RFC 6979)

RFC 6979 derives k deterministically from the private key and message hash. This eliminates RNG dependency and makes nonce reuse impossible. All modern implementations use RFC 6979.

EdDSA: Ed25519

Ed25519 (Edwards-curve DSA) uses Curve25519 twisted Edwards form. Deterministic by design. Constant-time. Faster than ECDSA. Recommended for new protocols (SSH keys, TLS 1.3, Signal).

Key Size Comparison

RSA-2048 signature: 256 bytes. ECDSA-256 signature: ~71 bytes. Ed25519 signature: 64 bytes. Ed25519 public key: 32 bytes. The size difference matters for constrained devices.

Standard Curves

NIST P-256 (secp256r1): TLS, FIPS compliance. secp256k1: Bitcoin, Ethereum. Curve25519/Ed25519: Signal, WireGuard, newer SSH. Brainpool: some European standards.

Quick Check

What catastrophic vulnerability is introduced if a DSA/ECDSA nonce k is reused?

Recap

You understand DSA, ECDSA, and Ed25519. Next we study how digital signatures protect real applications: code signing and email.

Frequently asked questions

Is the “DSA & ECDSA Signature Schemes” lesson free?

Yes — the full text of “DSA & ECDSA Signature Schemes” is free to read here on the web, and the Cryptology Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cryptology Academy course, upgrade to CoddyKit PRO.

What will I learn in “DSA & ECDSA Signature Schemes”?

Compare RSA signatures with DSA and the elliptic-curve variant. You practise Cryptology Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Cryptology Academy?

No prior experience is required. Cryptology Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “DSA & ECDSA Signature Schemes” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Cryptology Academy lesson?

Yes. Every Cryptology Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What Is a Digital Signature?
  2. RSA Signatures: Sign & Verify
  3. DSA & ECDSA Signature Schemes
  4. Signatures in the Wild: Code Signing & Email
← Back to Cryptology Academy