Comprehensive Study Notes on Cryptography and Public Key Encryption
Fundamentals of Cryptography and Encryption
Role of Cryptography in Cybersecurity:
Cryptography represents an essential branch of computer science that relies heavily on mathematical principles to secure and protect private information.
While preventative security controls are foundational in defending systems against various forms of cyber attacks, preventative measures alone are often insufficient to guarantee data privacy.
Encryption serves as the final and indispensable safeguard to protect secrets across unsecure or contested environments.
System architecture requires balancing the fundamental trade-off between usability and security when deciding where, when, and how to apply encryption protocols.
Core Definitions:
Encryption: The operational process of scrambling, modifying, or encoding a plaintext message into an unreadable format to prevent unauthorized observers from understanding its true meaning.
Decryption: The inverse process of unscrambling encoded, unreadable text (ciphertext) back into its original, comprehensible format (plaintext).
Key: A specific secret parameter, numerical value, or password that dictates the functional transformation during encryption and decryption, allowing an authorized party to lock or unlock the code.
Classical Symmetric Ciphers: The Caesar Cipher
Historical Background:
Tactics for obfuscating communications have been utilized for millennia by individuals and leaders seeking to preserve message privacy.
A famous historical implementation is the Caesar cipher, developed and utilized by Julius Caesar for military communication.
Mechanism of the Caesar Cipher:
The cipher operates via a substitution method that shifts each letter in the alphabet by a predefined number of spaces to the left or to the right.
The number of shifting positions acts directly as the secret key.
Concrete Application and Example:
Chosen Shift Value: Shift of spaces.
Letter Transformations:
The letter "a" shifts by positions to become "c".
The letter "b" shifts by positions to become "d".
Plaintext Message Example: Informing a recipient of a favorite band, "Abba".
Encrypted Message Output: Encrypting "Abba" with a shift of yields the ciphertext "c d d c".
Decryption Procedure: The recipient, possessing knowledge that the key is a shift of , systematically unshifts each character backward by positions to recover "Abba".
Limitations of Symmetric Key Systems in Modern Environments:
Symmetric Encryption Concept: The exact same key utilized to encrypt the plaintext message must be used by the recipient to decrypt the message.
The Key Distribution Problem:
A symmetric scheme functions adequately when communicating parties can meet beforehand in person to agree upon the shared secret key (e.g., Julius Caesar briefing his generals in person prior to deploying them into the field).
It fails in modern online communications where communicating parties interact across vast physical distances and cannot meet in person prior to sending transmission data.
Parties cannot securely agree upon a shared symmetric key over a public transmission medium without exposing the key itself to interception.
Public Key Cryptography and Asymmetric Encryption
The Public Network Threat Model:
Digital communications over the Internet transmit data across public, unencrypted networks.
Network architecture must always operate under the foundational assumption that an unauthorized third-party eavesdropper (conventionally designated as "Eve") is actively monitoring, intercepting, and reading all transmitted data.
Security systems must enable secure transmission across open channels such that Eve can observe the raw traffic without being able to decipher or understand its underlying content.
Concept of Asymmetric Encryption:
Asymmetric encryption resolves the key exchange dilemma by utilizing two mathematically related, distinct keys rather than a single shared key:
Public Key: Used to encrypt the message; freely distributed and visible to everyone.
Private Key: Used to decrypt the message; kept strictly secret by the intended recipient.
The Email Analogy:
Public Knowledge (Email Address): An individual's email address is public and can be shared openly with anyone who wishes to transmit an email to that person.
Private Knowledge (Account Password): Sending an email to an address does not grant the sender access to read the recipient's inbox. Accessing and reading incoming messages requires the recipient's private password, which is known exclusively to the account owner.
The Alice, Bob, and Eve Protocol Workflow:
Setup: Bob generates a key pair and publishes his public key openly so that anyone wishing to communicate with him can access it.
Encryption Step: Alice intends to send a confidential message to Bob. Alice encrypts her message using Bob's publicly available key.
Transmission Step: Alice transmits the encrypted ciphertext across the public network.
Interception: Eve intercepts and eavesdrops on the transmission over the public network; however, because the transmission is encrypted with Bob's public key, Eve cannot interpret the content.
Decryption Step: Bob receives the ciphertext and decrypts it using his unique, secret private key. Because only Bob's private key has the capability to decrypt messages scrambled by Bob's public key, only Bob can read the plaintext.
Mathematical Foundations: Trapdoor Functions and Key Length
One-Way and Trapdoor Functions:
Asymmetric cryptography functions via mathematical constructions known as one-way functions or trapdoor functions.
A trapdoor function is defined by its asymmetry in computational difficulty: it is exceptionally easy to compute in the forward direction, but computationally intractable or extremely difficult to reverse unless one possesses specific secret trapdoor information.
The Paint Mixing Metaphor:
Forward Direction: Mixing two distinct colors of paint together on a canvas is straightforward and physically simple.
Reverse Direction: When given a single combined batch of mixed paint, it is virtually impossible to reverse the process to isolate and deduce the original two constituent color components.
Underlying Mathematical Mechanics:
Public key cryptography relies on the properties of very large prime numbers.
Implementations incorporate modular arithmetic, a mathematical system that operates on the remainders obtained from division operations.
These mathematical properties permit data encryption across public channels without allowing eavesdroppers to reverse-engineer the decryption mechanism.
Cryptographic Key Length and Security:
Common modern cryptographic specifications utilize key sizes such as or encryption.
Bit Structure: A key consists of a sequence of binary digits (zeros and ones).
Brute-Force Complexity:
Just as longer account passwords require significantly more time and computing power to guess, increasing key length exponentially expands the total number of possible combinations.
A key length of bits creates a search space that is computationally infeasible for unauthorized parties to guess or brute-force.
Key Terminology and Structural Comparison
Authorized User vs. Eavesdropper:
Authorized User: A trusted individual who possesses explicit permission and cryptographic clearance to access and read protected messages.
Eavesdropper (Eve): An unauthorized entity present on the transmission medium attempting to intercept data; security protocols must ensure eavesdroppers are strictly excluded from authorized status.
Systemic Comparison:
Symmetric Key Cryptography:
Key Structure: Employs a single identical key for both encryption and decryption.
Distribution Requirement: Parties must exchange the secret key in advance through a secure, private channel before communicating.
Historical Context: Dominated historical cryptography, including ancient substitution methods such as the Caesar cipher.
Operational Flaw: Impractical for global, spontaneous online communication due to the shared key distribution bottleneck.
Asymmetric Key Cryptography (Public Key Cryptography):
Key Structure: Employs two distinct, mathematically linked keys: a public key for encryption and a private key for decryption.
Distribution Requirement: Public keys can be broadcast openly across untrusted channels without compromising security.
Modern Context: Developed by computer scientists and mathematicians to support the Internet era.
Operational Advantage: Allows secure, end-to-end communication across public networks despite the guaranteed presence of active eavesdroppers.