Classical Cryptography Simulator

DSS - Digital Signature Standard

Comprehensive Digital Signature Standard implementation with detailed mathematical steps. Generate keys, create digital signatures, and verify authenticity using DSA algorithm.

Key Generation with Detailed Steps
Generate public and private keys with complete mathematical verification
Digital Signature Generation
Create digital signature for a message using your private key
Signature Verification
Verify the authenticity of a digital signature
Control Panel
DSS Mathematical Foundation
Complete mathematical formulation

Key Generation

1. Choose large prime p
2. Choose prime q where q | (p-1)
3. Find generator g where g^q mod p = 1
4. Choose private key x ∈ [1, q-1]
5. Calculate public key y = g^x mod p

Signature Generation

1. Choose random k ∈ [1, q-1]
2. Calculate r = (g^k mod p) mod q
3. Calculate s = k^(-1)(H(M) + x*r) mod q
4. Signature = (r, s)

Signature Verification

1. Calculate w = s^(-1) mod q
2. Calculate u1 = H(M) * w mod q
3. Calculate u2 = r * w mod q
4. Calculate v = ((g^u1 * y^u2) mod p) mod q
5. Valid if v == r
DSS Security Analysis
Understanding the security properties

Discrete Logarithm Problem

Computing private key x from public key y = g^x mod p is computationally hard

Random k Security

Random k must be unique for each signature. Reusing k compromises private key

Hash Function Security

Uses secure hash functions (SHA family) to prevent collision attacks

Digital Signature Properties

Provides authentication, integrity, and non-repudiation

DSS vs RSA Comparison

• DSS: Only signatures, faster signing
• RSA: Encryption + signatures, slower
• DSS: Based on discrete logarithm
• RSA: Based on integer factorization
• DSS: Smaller key sizes
Worked Example
Complete DSS example with step-by-step calculations

Example: p = 23, q = 11, g = 4, x = 7, k = 3, H(M) = 5

Public key y = 4^7 mod 23 = 4
r = (4^3 mod 23) mod 11 = 18 mod 11 = 7
s = 3^(-1)(5 + 7*7) mod 11 = 4 * 54 mod 11 = 4 * 10 mod 11 = 9
Signature = (7, 9)
Verification: w = 9^(-1) mod 11 = 5
u1 = 5 * 5 mod 11 = 3
u2 = 7 * 5 mod 11 = 2
v = ((4^3 * 4^2) mod 23) mod 11 = (64 * 16 mod 23) mod 11 = 18 mod 11 = 7
v = r (7 = 7) ✅ Signature valid