Asymmetric Encryption & Digital Signatures

Section II: Cryptographic Primitives

Army Cyber Institute

April 9, 2026

The Impossible Secret

  • Imagine needing to share a password with 1,000 friends around the world.
  • How do you keep it safe from spies listening in?
  • Before 1976, this was considered impossible without trusted middlemen.
  • This is the “key distribution problem.”

The Key-Distribution Crisis

  • In symmetric cryptography, each pair of users needs a unique shared key.
  • Number of keys grows as:
    \[ \frac{n(n-1)}{2} \]
  • For 100 users → 4,950 keys. For 1 million → ≈ 5 × 10¹¹ keys.
  • Managing, rotating, and securing them is impossible at scale.
  • We need a model where public information can enable private communication.

The Locked Mailbox Analogy

  • Imagine a mailbox with an open slot and a locked door.
  • Anyone can drop messages inside (public access).
  • Only the owner with the private key can open it and read them.
  • This is the essence of asymmetric cryptography:
    • One key to encrypt (public): mailbox slot
    • Another key to decrypt (private): mailbox key

Enter Public-Key Cryptography

  • Core idea: two mathematically linked keys—one public, one private.
  • Public key: shared freely for encrypting or verifying.
  • Private key: kept secret for decrypting or signing.
  • The relationship is easy to compute forward, but hard to reverse.
  • Foundation for modern internet security and blockchain wallets.

Public-Key Cryptography and Asymmetric Cryptography are synonymous and mean the same thing.

Symmetric vs Asymmetric Comparison

Feature Symmetric Asymmetric
Keys Same for encrypt/decrypt Public/Private pair
Speed Very fast Slower (computationally heavy)
Security Basis Shared secret Mathematical one-way function
Scalability Poor — \(\frac{n(n-1)}{2}\) keys Excellent — 2 keys per user
Use Case Bulk data encryption Key exchange, authentication, signatures

Trapdoor Functions

  • A trapdoor function is easy to compute in one direction but infeasible to reverse without a secret.
  • Example:
    • \(f(x) = x^{e} \bmod n\) is easy to compute.
    • Recovering \(x\) (taking modular roots) is hard without knowing factors of \(n\).
  • The secret information (like factors \(p\), \(q\)) acts as the trapdoor.
  • Enables encryption with one key and decryption with another.

Diffie–Hellman Key Exchange Analogy

Diffie–Hellman Key Exchange Concept

  • Goal: two parties derive the same shared secret without sending it.
  • Steps:
    1. Agree on a public base \(g\) and modulus \(p\).
    2. Alice picks private \(a\); Bob picks private \(b\).
    3. Exchange \(g^a \bmod p\) and \(g^b \bmod p\).
    4. Each computes shared key \(g^{a^{b}} \bmod p\).
  • Even if the messages are intercepted, the secret exponent remains unknown.

Mathematical Backdrop: Modular Exponentiation

  • Core building block of RSA and Diffie–Hellman.
  • Computations occur modulo a prime or composite number — results “wrap around.”
  • Example:
    \[ 7^4 \bmod 10 = 1 \]
  • Provides non-linear mapping and bounded outputs.
  • Easy to compute forward, infeasible to reverse without secret factors.

Computational Hardness Assumptions

Problem Description Used In Current Status
Integer Factorization Given \(N = p × q\), find \(p,q\). RSA No polynomial-time algorithm known
Discrete Logarithm Given \(g, y = g^{x} \bmod p\), find \(x\). Diffie–Hellman, DSA Hard for large p
Elliptic Curve DL Given P, Q = kP on curve, find k. ECC, ECDH, ECDSA Harder per bit than RSA
  • These “hard” problems underpin asymmetric security.
  • Quantum algorithms (Shor’s) threaten factorization & discrete logs → motivates post-quantum cryptography.

From Encryption to Signing

  • Encryption: uses public key to lock, private key to unlock.
  • Digital Signature: reverses the process—private key to sign, public key to verify.
  • Purpose shifts from confidentiality → authenticity + integrity.
  • Signatures prove:
    • The message came from the claimed sender.
    • The message has not been altered.

RSA Emerges

  • RSA is a widely used public-key cryptosystem that relies on the mathematical difficulty of factoring large prime numbers to secure data.
  • Origins: Introduced by Ron Rivest, Adi Shamir, and Leonard Adleman in 1978.
  • Capabilities: It provides a practical system for both confidentiality (encryption) and authenticity (digital signatures).

RSAConcept cluster_encryption Confidentiality (Encryption) cluster_signature Authenticity (Signature) M1 Message C1 Ciphertext M1->C1 Encrypt (Public Key) M1_out Message C1->M1_out Decrypt (Private Key) M2 Message S2 Signature M2->S2 Sign (Private Key) V2 Verification S2->V2 Verify (Public Key)

RSA Video (Optional)

RSA Key Generation Overview

  1. Choose two large primes: \(p, q\) (typically 2048–4096 bits).
  2. Compute: \(n = p × q\).
  3. Find: \(\phi(n) = (p – 1)(q – 1)\).
  4. Select public exponent: \(e\) (coprime to \(\phi(n)\), often 65537).
  5. Compute private exponent: \(d = e^{-1} \bmod \phi(n)\).
  6. Public key = (n, e); Private key = (n, d).
  • Decryption works because \(M^{ed} \bmod n = M\).

RSA Encryption & Decryption

  • Encryption: Anyone with public key (n, e) can compute this. \[ C = M^e \bmod n \]
  • Decryption: Only holder of private key d can compute this. \[ M = C^d \bmod n \]
  • Properties:
    • Reversible via modular arithmetic.
    • Works on small numeric blocks (real data padded and encoded).
    • Security depends entirely on factoring hardness.

Why RSA Works (Intuition)

  • Based on Euler’s theorem:
    \[ M^{\phi(n)} \equiv 1 \pmod{n} \] so \(M^{ed} \equiv M\).
  • Multiplying exponents \(e × d\) cycles the number “back” to its origin.
  • Only works if \(e, d\) chosen correctly relative to \(\phi(n)\).
  • Inversion without φ(n) is infeasible → security.

Elliptic Curve Cryptography (ECC)

  • Uses points on a curve:
    \[ y^2 = x^3 + ax + b \]
  • Keys:
    • Private key = random integer \(k\)
    • Public key = \(Q = kP\) (point multiplication)
  • Encryption / key exchange use elliptic-curve discrete log problem — hard to reverse.
  • Provides equal security with much smaller keys (256-bit ECC ≈ 3072-bit RSA).

ECC Video (Optional)

ECC vs RSA

Property RSA ECC
Underlying Problem Integer factorization Elliptic-curve discrete log
Typical Key Size (≈128-bit security) 3072 bits 256 bits
Performance Slower key generation & decryption Faster operations, smaller keys
Bandwidth / Storage Larger certificates & signatures Compact and efficient
Adoption Legacy (TLS, email) Modern systems, blockchain (e.g., Bitcoin, Ethereum)
  • ECC achieves the same security with far smaller keys.
  • Ideal for low-power devices and distributed systems.

Digital Signature Workflow

  1. Sender computes message hash (e.g., SHA-256).
  2. Sender signs the hash with private key → signature \(S\).
  3. Receiver gets (message, signature).
  4. Receiver verifies by checking:
    \[ \text{Verify}(S, M, \text{public key}) = \text{True} \]
  5. If valid → message authentic and intact.
  • Ensures integrity, authenticity, non-repudiation.
  • Used in SSL/TLS, software updates, and blockchain transactions.

Example: RSA Signature

  • Signing:
    \[ S = H(M)^d \bmod n \] (hash the message, then raise to private exponent)
  • Verification:
    \[ H(M) \stackrel{?}{=} S^e \bmod n \] (raise signature to public exponent and compare hashes)
  • Correctness guaranteed because \((H(M)^{d})^{e} \equiv H(M) \pmod{n}\).
  • Hashing prevents direct message manipulation and collision attacks.

Digital Signatures Microlab

Learn with Digital Signatures Microlab

Certificates and PKI Hierarchy

  • PKI (Public-Key Infrastructure): system that binds identities to public keys.
  • Certificates issued and digitally signed by Certificate Authorities (CAs).
  • Structure:
    • Root CA — self-signed, ultimate trust anchor.
    • Intermediate CAs — delegated signers.
    • End-Entity Certificates — for servers, users, or devices.
  • Each certificate contains public key, owner info, expiration, and CA signature.

Certificate Validation Process

  1. Browser receives server certificate.
  2. Checks signature chain up to trusted Root CA.
  3. Validates:
    • Certificate not expired.
    • Domain name matches subject.
    • Signature of issuer verifies.
  4. Checks revocation status (CRL / OCSP).
  5. If all checks pass → secure session established.

Real-World Failure: The pac4j-jwt Auth Bypass

  • The Context: Web applications use JSON Web Tokens (JWTs) to authenticate users. A JWT contains a payload (e.g., {"user": "alice", "role": "admin"}) secured by a digital signature.
  • The Vulnerability: A severe bug in the pac4j-jwt security library allowed attackers to completely bypass authentication.
  • How it Failed:
    • A logic flaw in the software’s validation process allowed attackers to craft tokens that tricked the library into skipping the signature verification step.
  • The Impact: Attackers could forge their identity and gain unauthorized administrative access.
  • The Lesson: Cryptographic math is robust, but implementation flaws are the most common point of failure. If the code fails to strictly enforce verification, the entire trust model collapses.

Attacker Mindset: Don’t break the cryptography; find a way to make the system ignore it.

Public Keys as Blockchain Addresses

  • In blockchain systems, a public key identifies a wallet or account.
  • The address is a hash of the public key (e.g., Bitcoin uses RIPEMD-160(SHA-256(pubkey))).
  • Transactions are digitally signed with the private key → verified using the public key.
  • This provides ownership without identity — pseudonymity, not anonymity.
  • Loss of private key = loss of access.

Compromised Keys and Revocation Failures

  • Private-key compromise breaks authenticity and confidentiality.
  • Revocation mechanisms:
    • PKI: Certificate Revocation Lists (CRL) and Online Certificate Status Protocol (OCSP).
    • Blockchain: no central revocation — lost or stolen keys remain valid until funds moved.
  • Famous incidents:
    • 2011 DigiNotar CA compromise.
    • 2014 Heartbleed bug exposing private keys.
    • 2016 Bitfinex Bitcoin theft (key management failure).
  • Lesson: cryptography is only as strong as its key hygiene.

Quantum Threat Preview

  • Shor’s Algorithm (1994): polynomial-time factoring & discrete-log solver on quantum computers.
  • Breaks RSA, DH, ECC — renders most current public-key systems insecure.
  • Post-Quantum Cryptography (PQC): lattice-based, code-based, and hash-based alternatives.
  • NIST PQC Standardization (2022 → 2025): CRYSTALS-Kyber (key exchange) and Dilithium (signatures).
  • Blockchain relevance: future migration to quantum-safe wallets and consensus proofs.

Summary

  • Asymmetric cryptography solves the key-distribution problem using public/private pairs.
  • Trapdoor functions make forward computation easy but reversal infeasible.
  • RSA relies on integer factorization; ECC on the discrete-log problem.
  • Digital signatures provide authenticity and integrity.
  • PKI formalizes trust through hierarchical certificate authorities.
  • Blockchain adapts these principles for decentralized identity and verification.

References

[1]
W. Diffie and M. Hellman, “New Directions in Cryptography,” in IEEE Transactions on Information Theory, 1976, pp. 644–654. doi: 10.1109/TIT.1976.1055638.
[2]
A. J. Menezes, P. C. van Oorschot, and S. A. Vanstone, “Handbook of Applied Cryptography.” CRC Press, Aug. 07, 2011. Accessed: Oct. 23, 2025. [Online]. Available: https://cacr.uwaterloo.ca/hac/
[3]
J. Katz and Y. Lindell, Introduction to Modern Cryptography, 3rd ed. Chapman and Hall/CRC, 2020. doi: 10.1201/9781351133036.
[4]
R. L. Rivest, A. Shamir, and L. Adleman, “A method for obtaining digital signatures and public-key cryptosystems,” Commun. ACM, vol. 21, no. 2, pp. 120–126, Feb. 1978, doi: 10.1145/359340.359342.
[5]
D. Boneh and V. Shoup, “Hash Functions.” 2020. Available: https://intensecrypto.org/public/lec_07_hash_functions.html
[6]
D. R. Stinson and M. B. Paterson, Cryptography: Theory and practice, Fourth edition, first issued in paperback. Boca Raton, FL: Chapman & Hall/CRC Press, 2022.
[7]
D. Boneh and V. Shoup, “Introduction to Public-Key Cryptography.” 2020. Available: https://intensecrypto.org/public/lec_10_public_key_intro.html
[8]
S. Nakamoto, “Bitcoin: A Peer-to-Peer Electronic Cash System.” Satoshi Nakamoto Institute, Oct. 31, 2008. Accessed: Sep. 12, 2025. [Online]. Available: https://cdn.nakamotoinstitute.org/docs/bitcoin.pdf
[9]
A. M. Antonopoulos, Mastering Bitcoin: Programming the open blockchain, Second edition. Sebastopol, CA: O’Reilly, 2017.
[10]
E. Barker, “Recommendation for key management: Part 1 - general,” National Institute of Standards and Technology, Gaithersburg, MD, NIST SP 800-57pt1r5, May 2020. doi: 10.6028/NIST.SP.800-57pt1r5.
[11]
Department of Justice, “Bitfinex hacker and wife plead guilty to money laundering conspiracy involving billions in cryptocurrency,” U.S. Dept. of Justice, Washington, D.C., Press Release, Aug. 2023. Accessed: Oct. 28, 2025. [Online]. Available: https://www.justice.gov/archives/opa/pr/bitfinex-hacker-and-wife-plead-guilty-money-laundering-conspiracy-involving-billions