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) and send it to Alice.
- Alice will decrypt the ciphertext c by: m=Dsk(c).
Requirements for Public-Key Cryptography
Properties of Epk
- Efficient Computation: The encryption function (Epk) must be efficient to compute.
- Hard Inversion: The decryption function, which is the inverse of Epk, denoted as E<em>pk−1=D</em>sk, must be hard to compute unless the private key sk is known.
- 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), where Alice creates the signature using her private key s=Dsk(m).
- Verification process requires public key to confirm: V(m,s)extusingpk.
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)=xemodn
where:
- n=pq (p and q are distinct primes)
- e must be relatively prime to φ(n)=(p−1)(q−1).
Function Characteristics
- Limited to multiplicative group of integers:
f 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)=xdmodn
where d is the decryption exponent such that: ed≡1modφ(n).
Security and Efficiency of RSA
- Efficiency of function computation for encryption and decryption is O(extlogn).
- 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=3;
- n=pimesq=253;
- φ(n)=(p−1)(q−1)=220;
- Compute decomposition exponent:
- d=147 (Check ed=1modφ(n)).
Encryption and Decryption Process
- Message Representation: For example, binary message 0111001 representing m=57.
- Encryption Calculation:
E(m)=memodn=573mod253=250 (denote as c). - Decryption Calculation:
D(c)=cdmodn=250147mod253=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/2n for producing the same hash output for different inputs.
Properties
- Preimage Resistance: It is computationally hard to find any input that hashes to a given output.
- 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
- Peggy commits by sending a random computation output calculated from her secret.
- 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.