Digital Signatures Scheme
For a very brief theory of digital signature schemes and their analysis, click here
Digital signatures are cryptographic mechanisms that provide authentication, integrity, and non-repudiation for digital documents and messages. Unlike handwritten signatures, digital signatures use mathematical algorithms to ensure that a document hasn't been altered and to verify the identity of the signer. They do not, however, provide confidentiality — encrypting the message content itself for privacy requires a separate encryption step in addition to signing.
How Digital Signatures Work
The digital signature process involves three main phases:
1. Hash Generation: The original message is processed through a cryptographic hash function (such as SHA-1, used in this experiment, or SHA-256 in modern systems) to create a fixed-size digest .
2. Signature Creation: The hash is encrypted using the signer's private key to create the digital signature .
3. Verification:
Recipients can verify the signature using the signer's public key to decrypt the signature and compare it with a freshly computed hash.
Why Hashing Is Essential: Hashing before signing is not just a convenience — it is a security requirement.
- Efficiency: RSA operations are computationally expensive. Signing a short, fixed-size hash (e.g., 160 or 256 bits) is far cheaper than signing an arbitrarily long message directly, and lets the scheme handle messages of any size, even those larger than the modulus .
- Security against forgery: If a scheme signs the raw message directly, , RSA's multiplicative structure becomes exploitable. Given two valid signatures and , an attacker can compute
which is a valid forged signature for the message — without ever knowing the private key . A cryptographic hash function is not multiplicative in this way ( in general), so hashing first breaks this algebraic shortcut and is what makes "sign-the-hash" schemes resistant to this class of existential forgery.
RSA-Based Digital Signatures
RSA (Rivest–Shamir–Adleman) is widely used for digital signatures due to its mathematical foundation:
Key Properties:
- Key Generation: Create a public–private key pair and
- Signing: Encrypt the message hash with the private key:
- Verification: Decrypt the signature with the public key:
Note: This experiment focuses on RSA-based signatures. This should not be confused with the NIST Digital Signature Algorithm (DSA), a separate, distinct signature scheme based on the discrete logarithm problem rather than integer factorization — DSA is not used in this experiment.
RSA Security Assumption: The security of RSA digital signatures relies on the believed difficulty of the Integer Factorization Problem:
More precisely, forging signatures without requires solving the RSA problem — computing -th roots modulo — which is at least as easy as factoring , though whether it is exactly as hard as factoring remains an open question in cryptography.
Trapdoor Function: RSA uses a trapdoor one-way function:
- Easy direction (for anyone): Computing is efficient using only the public key .
- Easy direction (with the trapdoor): If you know the private exponent — the "trapdoor" — recovering is equally efficient.
- Hard direction (without the trapdoor): Given only , , and , and without knowing or the factorization of , finding such that is believed to be computationally infeasible for sufficiently large .
Mathematical Representation
For RSA digital signatures:
Signature Generation:
Signature Verification:
Where:
- is the hash of message
- is the private key exponent
- is the public key exponent
- is the modulus ( for primes and )
RSA Key Generation Process:
Choose two large prime numbers and
Compute
Compute Euler's totient function:
Choose public exponent such that and
Compute private exponent such that
(Modern implementations, e.g. FIPS 186-5, often use the Carmichael function instead of in this step, since divides and gives the smallest valid private exponent — but computing from , as taught here, also yields a mathematically valid key.)
Digital Signature Algorithm Steps:
Signing Process:
- Compute message hash:
- Generate signature:
- Send to verifier
Verification Process:
- Compute message hash:
- Decrypt signature:
- Verify: signature is valid if
Security Properties
Digital signatures provide three key security properties:
- Authentication: Verifies the identity of the message sender
- Integrity: Ensures the message hasn't been modified
- Non-repudiation: Prevents the sender from denying they signed the message
Does not provide — Confidentiality: A digital signature does not hide the message. travels alongside in plain form, so anyone who intercepts can read regardless of whether they verify the signature. Achieving confidentiality requires separately encrypting (e.g., with the recipient's public key) in addition to signing it.
Key Size Considerations
The security of RSA digital signatures depends on key size and computational complexity. Let denote the bit-length of the modulus (i.e., a "-bit key"). Approximate security levels, following the widely cited NIST SP 800-57 equivalences to symmetric-key strength, are:
| Key Size () | Approx. Security Level | Status | Use Case |
|---|---|---|---|
| 512-bit | operations | Broken in practice (factored publicly since 1999) | Educational demonstration only |
| 1024-bit | operations | Deprecated by NIST for federal use since 2013 | Legacy systems only |
| 2048-bit | operations | Currently recommended minimum | Production use |
| 3072-bit | operations | Recommended for long-term security (beyond 2030) | High-value, long-lived data |
| 4096-bit | operations (approx.) | High security, not an official NIST tier | High-value applications |
Security Growth (Advanced / Optional Reading): The best known classical algorithm for factoring the RSA modulus (the actual large integer, not its bit-length) is the General Number Field Sieve (GNFS), with heuristic sub-exponential running time:
Here is the natural logarithm and is the modulus itself. This grows faster than any polynomial in (the bit-length), which is why increasing key size rapidly increases factoring cost — but it is still sub-exponential, unlike the fully exponential brute-force cost of a symmetric cipher like DES with a comparable key length. This classical hardness assumption would also be broken by a sufficiently large quantum computer running Shor's algorithm, which factors integers in polynomial time — a key reason post-quantum signature schemes are being standardized for future use.
Performance vs Security Trade-off:
- Signature time: for a -bit modulus, using schoolbook modular exponentiation (faster with optimized multiplication algorithms)
- Verification time: Typically faster than signing, due to the small public exponent (often )
- Key generation time: Increases significantly with key size due to the cost of primality testing for larger and