Comprehensive Study Notes on Private Key vs Public Key Cryptography and RSA

Private-key Cryptography vs Public-key Cryptography

  • Presenter: Ming-Deh Huang, Computer Science Department, University of Southern California
  • Date: February 22, 2026

Overview of Cryptography

  • Private-key Cryptography
    • Uses a single key for both encryption and decryption.
  • Public-key Cryptography (PKC)
    • Utilizes a pair of keys: a public key (pk) for encryption and a private key (sk) for decryption.

Recap of Previous Discussions

  • Informational Security
    • Focus on one-time pad and its significance.
    • Offers perfect secrecy based on key length.
  • Computational Security Based on Pseudorandomness
    • Security based on the unpredictability of pseudorandom sequences.
  • One-Way Functions
    • Functions that are easy to compute in one direction but hard to invert.

Suggested Readings

  • Recommended chapters from "Introduction to Modern Cryptography" by Jonathan Katz and Yehuda Lindell: 4, 5, 7, 10, A, and B.

Public Key Cryptosystem

Key Pair Definition

  • Alice holds a key pair:
    • Public Key (pk): Known to everyone.
    • Secret Key (sk): Known only to Alice.

Functionality

  • Encryption: Anyone can encrypt a message to Alice using her public key (Epk).
  • Decryption: Only Alice can decrypt messages with her secret key (Dsk).
    • Therefore, Epk is public and known.
    • Dsk is private and only known to Alice.

Example Usage

  • Anyone can encrypt a message m by the operation: c←Epk(m)c \leftarrow E_{pk}(m) and send it to Alice.
  • Alice will decrypt the ciphertext c by: m=Dsk(c)m = D_{sk}(c).

Requirements for Public-Key Cryptography

Properties of Epk

  1. Efficient Computation: The encryption function (Epk) must be efficient to compute.
  2. Hard Inversion: The decryption function, which is the inverse of Epk, denoted as E<em>pk−1=D</em>skE<em>{pk}^{-1} = D</em>{sk}, must be hard to compute unless the private key sk is known.
  3. Trapdoor One-Way Function: Epk should be a trapdoor function; it should be easy to compute but hard to invert unless trapdoor information (sk) is available.

Digital Signatures

Overview

  • Alice is identified as the owner of the private key (sk) corresponding to her public key (pk).
  • The signing function is based on the private key, while verification uses the public key.

Signing and Verifying

  • A message m with signature s can be created:
    • Signature Equation: (m,s)(m,s), where Alice creates the signature using her private key s=Dsk(m)s = D_{sk}(m).
  • Verification process requires public key to confirm: V(m,s)extusingpkV(m,s) ext{ using } pk.

Public Key Systems Concept

  • A public key serves to identify the owner of the corresponding secret key.
  • Individuals generate multiple public keys to create distinct identities.
  • Systems like Bitcoin utilize decentralized identity management based on public keys.

RSA Cryptosystem

RSA Function Definition

  • The RSA function: f : \{0, . . . , n−1} \to \{0, . . . , n−1} f(x)=xemod  nf(x) = x^{e} \mod n where:
    • n=pqn = pq (p and q are distinct primes)
    • ee must be relatively prime to φ(n)=(p−1)(q−1)φ(n) = (p - 1)(q - 1).

Function Characteristics

  • Limited to multiplicative group of integers:
    ff is bijective (one-to-one and onto) restricted to Z_{n}^{*} = \{a : a \in \{0,…,n-1}, gcd(a,n) = 1}.
  • Inversion of f is given by:
    f−1(x)=xdmod  nf^{-1}(x) = x^{d} \mod n
    where dd is the decryption exponent such that: ed≡1mod  φ(n)ed \equiv 1 \mod φ(n).

Security and Efficiency of RSA

  • Efficiency of function computation for encryption and decryption is O(extlogn)O( ext{log} n).
  • If the private exponent d can be determined from e and n, it enables factoring n efficiently, thereby compromising security.

Example of RSA

Basic Example

  • Given:
    • p=11,q=23,e=3p = 11, q = 23, e = 3;
    • n=pimesq=253n = p imes q = 253;
    • φ(n)=(p−1)(q−1)=220φ(n) = (p-1)(q-1) = 220;
  • Compute decomposition exponent:
    • d=147d = 147 (Check ed=1mod  φ(n)ed = 1 \mod φ(n)).

Encryption and Decryption Process

  1. Message Representation: For example, binary message 0111001 representing m=57.
  2. Encryption Calculation:
    E(m)=memod  n=573mod  253=250E(m) = m^{e} \mod n = 57^{3} \mod 253 = 250 (denote as c).
  3. Decryption Calculation:
    D(c)=cdmod  n=250147mod  253=57D(c) = c^{d} \mod n = 250^{147} \mod 253 = 57.

Effects of Public Key Encryption

  • Public key systems allow for more decentralized and adaptable identity management.

Chosen-Ciphertext and Chosen-Message Attacks

Definitions

  • Chosen-Ciphertext Attack: An adversary allows the decryption of chosen ciphertexts.
  • Chosen-Message Attack: An adversary requests the signature for chosen messages and uses the response to forge valid messages.

Attack Realizations

  • Through message adjustments over RSA operations, attackers exploit malleability of RSA without direct access to decryption keys.

Mitigation Strategies

  • Implement a hash-then-sign method where the message is first hashed before signing. This process creates a fixed-length input to the signature scheme, enhancing security against potential forgery.

Cryptographic Hash Functions

Definition

  • Hash Function: H : \{0, 1}^{*} \to \{0, 1}^{n};
    • Collisions are rare, with a probability of approximately 1/2n1/2^n for producing the same hash output for different inputs.

Properties

  1. Preimage Resistance: It is computationally hard to find any input that hashes to a given output.
  2. Collision Resistance: Identifying two different inputs that produce the same output is difficult.

Existence of Hash Functions

  • Ongoing research aims to design collision-resistant hash functions.
  • Examples of practical hash functions include MD-5 and SHA families.

Zero-Knowledge Proofs

Definition

  • A zero-knowledge proof allows a prover to demonstrate knowledge of certain information without disclosing the information itself.

Application Sequence

  • In the Fiat-Shamir identification scheme, the prover (Peggy) can prove she knows a square root without revealing it, using an interactive protocol with a verifier (Victor).

Protocol Steps

  1. Peggy commits by sending a random computation output calculated from her secret.
  2. Victor sends a challenge, and Peggy responds appropriately based on the challenge.
Validity and Security
  • The scheme is considered valid if the transcript can be generated without revealing extra information. It operates under the premise of zero-knowledge where successful verification does not compromise the prover's secret.

Conclusion

  • Understanding the differences in cryptographic techniques is crucial for implementing secure systems.
  • The implications of security protocols extend to various applications, including digital signatures, secure communications, and identity verification.