Chapter 6: Encryption Fundamentals

Fundamentals and Role of Encryption

  • Core Security Purpose:

    • Encryption is fundamental to network defense; regardless of the number of firewalls or security instruments implemented within an infrastructure, unencrypted traffic remains completely vulnerable to compromise.

    • Security efficacy is fundamentally defined by time: there is no such thing as an unbreakable encryption algorithm; rather, the strength and security of an algorithm are determined strictly by how long it takes to decrypt the information.

  • Primary Course Objectives:

    • Explain fundamental encryption concepts and mechanics.

    • Trace the historical progression of cryptography to modern cryptographic algorithms.

    • Implement and execute basic decryption and cryptanalytic techniques.

History and Early Methods of Cryptography

  • Historical Progression:

    • Original Context: Encryption originated primarily for military communications and was initially restricted to written messages.

    • Technological Expansion: Cryptographic applications later expanded to encompass telephone, radio, and computer/Internet communications.

    • Algorithmic Complexity: Over the decades, cryptographic mechanisms transitioned from basic manual ciphers to increasingly complex mathematical systems.

  • Early Encryption Techniques:

    • Single-Alphabet Substitution Ciphers:

    • The Caesar Cipher: Replaces each plaintext character with a letter a fixed number of positions down the alphabet.

    • ROT 13: A specific Caesar cipher variant that rotates letters by 1313 positions.

    • Atbash Cipher: A substitution cipher where the alphabet is mapped to its reverse (e.g., first letter maps to the last letter).

    • Multi-Alphabet Substitution Ciphers: Systems employing multiple substitution alphabets across the encryption process to defeat basic frequency patterns.

    • Rail Fence Cipher: A transposition cipher where plaintext is written diagonally across multiple virtual "rails" and read off in horizontal rows.

    • Vigenère Cipher: A polyalphabetic substitution cipher utilizing a keyword and a grid (Vigenère table/tabula recta).

    • Enigma Machine: An electro-mechanical rotor cipher device historically employed for military field communications.

  • Fundamental Binary Operations in Cryptography:

    • AND Operation: Evaluates bit pairs where the output is 11 only if both input bits are 11 (1+1=11 + 1 = 1).

    • OR Operation: Evaluates bit pairs such that there must be a 11 in either of the corresponding bit positions to yield a 11 in that position.

    • XOR (Exclusive OR) Operation: Evaluates bit pairs such that if a position has a 11 in one number but not the other, the resulting output is 11; if both bits are the same (00 and 00, or 11 and 11), the result is 00.

  • Academic and External Cryptographic Resources:

    • Coursera Cryptography I Course: https://www.coursera.org/course/crypto

    • Udacity Applied Cryptography Course: https://www.udacity.com/course/appliedcryptography--cs387

    • Cypher Research Laboratories History Archive: www.cypher.com.au/crypto_history.htm

Modern Symmetric Encryption

  • Architecture of Symmetric Encryption:

    • Employs a single shared secret key for both encryption and decryption operations.

    • Requires secure out-of-band key exchange or key management architectures.

  • Primary Symmetric Ciphers:

    • Data Encryption Standard (DES):

    • Symmetric key block cipher system.

    • Processing cycle:

      1. Plaintext data is divided and initially transposed.

      2. Data is routed through a succession of iterative rounds/steps.

      3. Data is scrambled using a swapping algorithm.

      4. The resulting blocks are transposed one final time to form ciphertext.

    • Blowfish:

    • Symmetric block cipher.

    • Designed in 19931993 by Bruce Schneier as a fast, free alternative to existing algorithms.

    • Advanced Encryption Standard (AES):

    • Based on the Rijndael algorithm.

    • Symmetric block cipher standard adopted internationally.

    • Formally specifies three distinct key length variants:

      • 128 bits128\text{ bits}

      • 192 bits192\text{ bits}

      • 256 bits256\text{ bits}

    • International Data Encryption Algorithm (IDEA):

    • Uses subkeys systematically derived from an initial master key of 128 bits128\text{ bits}.

    • Mathematical procedure for key scheduling:

      1. The primary 128-bit128\text{-bit} key is split directly into eight 16-bit16\text{-bit} subkeys.

      2. The primary key bits are shifted circular left by 25 bits25\text{ bits} to produce a modified key base from which subsequent subkeys are derived.

      3. This shift-and-extract sequence is iteratively executed until a total of 52 subkeys52\text{ subkeys} are generated.

    • Serpent: A symmetric block cipher developed as an AES competition finalist.

    • Twofish: A symmetric block cipher developed by Bruce Schneier and colleagues as an AES competition finalist.

  • Criteria for Selecting Symmetric Ciphers:

    • Standard Business Data: Virtually any modern symmetric algorithm provides adequate baseline security.

    • High-Volume/Bulk Data: Execution throughput and cryptographic speed are nearly as critical as baseline security to prevent processing bottlenecks.

    • Highly Sensitive Data: Security strength takes total precedence over processing latency, regardless of speed trade-offs.

    • Variable Length Keys: Only relevant if the target infrastructure or application explicitly demands adaptable key lengths.

Key Management, Generation, and Stretching

  • Pseudo-Random Number Generators (PRNG):

    • Symmetric ciphers mandate unpredictable cipher keys; PRNG engines provide algorithmic key material.

    • PRNG keys are not purely non-deterministic, but are engineered to be "random enough" to resist cryptanalytic predictability.

    • Three mandatory PRNG characteristics:

    • Uncorrelated Sequences: Successive outputs must demonstrate zero statistical correlation with prior values.

    • Long Period: The algorithm must cycle through an exceptionally large sequence of outputs before repeating any internal state.

    • Uniformity: Output bit distributions must exhibit an even, flat probability spread across the entire numeric domain.

  • Key Stretching Mechanics:

    • A cryptographic method that systematically lengthens and complicates a weak input key or password, drastically increasing brute-force work factors.

    • Password-Based Key Derivation Function 2 (PBKDF2):

    • Standardized within PKCS #5 v 2.01.

    • Iteratively applies a pseudorandom function (such as a keyed HMAC) to an input password or passphrase in conjunction with a cryptographic salt to yield a hardened derived key.

    • bcrypt:

    • A password-hashing and key-stretching function based on the Blowfish symmetric cipher.

    • Incorporates adaptive work factors and salt to protect stored credentials against massive hardware scaling.

Public Key (Asymmetric) Encryption

  • Asymmetric Architecture:

    • Serves as the mathematical inverse of single-key encryption by utilizing a mathematically related key pair.

    • Public Key: Distributed freely and openly; enables any sender to encrypt data destined for the owner.

    • Private Key: Kept strictly confidential by the owner; serves as the sole mathematical mechanism capable of decrypting data encrypted with the matching public key.

    • Performance Metric: Substantially slower and more computationally intensive than symmetric block ciphers.

  • Public Key Algorithms:

    • RSA:

    • Formulated in 19771977 by Ron Rivest, Adi Shamir, and Leonard Adleman.

    • The most pervasive asymmetric algorithm in computing history.

    • Relies on the extreme computational difficulty of prime factorization (factoring the product of two very large prime numbers).

    • Diffie-Hellman: Key exchange protocol allowing secure secret exchange over untrusted channels.

    • ElGamal: Asymmetric public-key system based on the Diffie-Hellman discrete logarithm problem.

    • MQV (Menezes-Qu-Vanstone):

    • An authenticated key agreement mechanism based on the Diffie-Hellman scheme.

    • Digital Signature Algorithm (DSA):

    • A United States Federal Information Processing Standard for digital signatures.

    • Elliptic Curve Cryptography (ECC):

    • An asymmetric architecture relying on the algebraic structures of elliptic curves over finite fields, yielding equivalent cryptographic strength at substantially smaller key sizes.

  • Indicators of Questionable Cryptographic Implementations:

    • Systems advertised or marketed as absolutely "unbreakable".

    • Solutions claiming proprietary, non-standard "certified" security outside open evaluation criteria.

    • Systems developed, engineered, or promoted by inexperienced, unvetted cryptographic vendors.

Digital Signatures, Certificates, and Trust Infrastructures

  • Digital Signatures:

    • Inverts standard asymmetric operations to provide non-repudiation, message integrity, and sender authentication.

    • Signing Process: The sender encrypts or signs a cryptographic digest of the message using their own private key.

    • Verification Process: Any recipient accesses the sender's openly distributed public key to decrypt and validate the signature against the message.

  • Digital Certificates and X.509:

    • Digital Certificate: A digitally signed data document containing an entity's public key, identifying metadata, and the digital signature of a trusted third-party issuer.

    • Functionality: Distributes public keys globally while providing guaranteed verification of the owner's true identity.

    • X.509: The recognized international standard governing the structural layout, field formats, and information schemas embedded in digital certificates.

  • Public Key Infrastructure (PKI) and Authorities:

    • Certificate Authority (CA): The authoritative entity whose primary role is to validate identities, digitally sign certificates, and publish the verified public keys of enrolled users.

    • Registration Authority (RA): An intermediary verification component tasked with vetting and confirming user identities before forwarding requests to the CA for certificate issuance.

    • PKI Ecosystem: The interconnected arrangement of policies, processes, software, hardware, and networks of trusted CA servers that bind public keys to specific human or device identities.

  • Pretty Good Privacy (PGP) Architecture:

    • PGP is an integrated cryptographic framework rather than a singular isolated algorithm.

    • Integrates symmetric encryption, asymmetric encryption, and digital signatures into unified messaging solutions, frequently built directly into email clients.

    • Utilizes its own independent certificate formatting schema.

    • Web of Trust Model: PGP certificates are decentralized and self-generated by individual users, completely bypassing centralized Certificate Authorities.

Cryptographic Hashing

  • Hashing Mechanics:

    • Mathematical functions that consume an arbitrary, variable-size input message and produce a fixed-size output string called a hash value or digest.

    • One-Way Property: Strict irreversibility; the output cannot mathematically be reverse-engineered or "un-hashed" to expose the original plaintext.

    • Operating System Applications: Used natively within Microsoft Windows operating systems to store hashed password representations rather than cleartext.

    • Cryptographic Salt: Randomly generated bit strings appended to the plaintext prior to hashing; mathematically mitigates precomputed rainbow table dictionaries and identical hash lookups.

  • Hashing Algorithms:

    • Secure Hash Algorithm (SHA):

    • The industry's most widely adopted family of cryptographic hash functions.

    • Encompasses successive generations: SHA-1, SHA-2, and SHA-3.

    • MD5 (Message Digest 5):

    • Historically ubiquitous 128-bit128\text{-bit} digest.

    • Defeated due to identified cryptographic vulnerabilities; lacks collision resistance (two disparate inputs generating identical digests).

    • RACE Integrity Primitives Evaluation Message Digest (RIPEMD):

    • A suite of cryptographic hash algorithms based upon the design principles of MD4.

    • HAVAL:

    • A variable-output cryptographic hash function producing message digests of varying lengths.

Cryptanalysis and Password Cracking

  • Password Cracking Paradigms:

    • Security administrators routinely leverage automated password crackers defensively to audit internal system password policies and defense margins.

    • John the Ripper:

    • An open-source, freely downloadable offline password cracker hosted at www.openwall.com/john/.

    • Operates exclusively against extracted offline password database files, never against real-time live input prompts.

    • The exact storage directories and configurations of target password files vary depending on the target host operating system.

    • Successfully cracked plaintexts are written to an internal flat-file database titled john.pot.

    • Rainbow Tables: Precomputed lookup databases containing immense inventories of pre-hashed strings mapped to their corresponding cleartext values to bypass compute-heavy brute forcing.

    • Alternative Cracking Platforms and Reference Archives:

    • Russian Password Crackers Portal: www.password-crackers.com/crack.html

    • Elcomsoft Password Recovery: www.elcomsoft.com/prs.html

    • LastBit Password Recovery: http://lastbit.com/mso/Default.asp

  • General Cryptanalysis Disciplines:

    • Defined as the empirical science of discovering flaws, mathematical exploits, or alternate pathways to breach cryptographic protections without prior possession of the valid key.

    • Highly tedious and mathematically exhaustive, offering zero systemic guarantees of success; direct cryptanalysis against modern ciphers is rarely successful.

    • Standard Cryptanalytic Methodologies:

    • Brute Force: Exhaustive trial-and-error cycling through every mathematically possible permutation of a key.

    • Frequency Analysis: Statistical examination of character distributions within ciphertext to identify underlying natural language patterns.

    • Known Plaintext: Attacks where the analyst possesses both the plaintext and corresponding ciphertext for portions of a message to deduce key data.

    • Chosen Plaintext: Attacks where the cryptanalyst selects arbitrary plaintext blocks and obtains the resulting ciphertexts generated by the target system.

    • Related Key Attack: Attacks where the analyst observes the cryptographic operation of a cipher using mathematical relationships between different unknown keys.

    • Birthday Attack: Attacks exploiting probability mathematics (the birthday problem) to locate hash collisions in mathematical algorithms.

    • Differential Cryptanalysis: Analysis examining how specific differences in plaintext pairs affect the resultant differences in output ciphertext pairs.

    • Linear Cryptanalysis: High-order mathematical attack utilizing linear approximations to model the internal operation of block ciphers.

Steganography and Steganalysis

  • Steganography Principles:

    • Defined as the art and science of hiding covert data within an innocuous file in a manner such that unauthorized observers do not even suspect the communication exists.

    • Diverges fundamentally from standard encryption: encryption scrambles messages to make them unreadable, while steganography obscures the existence of the message entirely.

    • Typically embeds data secretly within high-density multimedia files, such as digital images or audio files, without generating visible or audible artifacts.

  • Core Steganographic Terminology:

    • Payload: The underlying secret data or covert message intended to be concealed and communicated.

    • Carrier: The host signal, continuous stream, or digital container file (e.g., bitmap, audio track) within which the secret payload is concealed.

    • Channel: The transmission vector or specific media category through which the carrier is routed.

  • Steganography Software Suites:

    • QuickStego

    • Invisible Secrets

    • MP3Stego

    • Stealth Files 4

    • SNOW

  • Steganalysis Frameworks:

    • The counter-discipline dedicated to intercepting, detecting, analyzing, and extracting hidden steganographic data.

    • Detection Methodologies:

    • Raw Quick Pair (RQP) Method: Evaluates statistical pixel pair ratios within image carriers.

    • Chi-Square (χ2\chi^2) Analysis: Statistical test analyzing deviation from expected theoretical frequency distributions across digital media bytes.

    • Audio Carrier Noise Analysis: Precision acoustic examination measuring irregular distortion profiles and background noise anomalies within audio carrier files.

Quantum Computing and the Future of Cryptography

  • Quantum Architectural Shift:

    • Unlike classical digital computing architectures restricted strictly to binary states (00 and 11), quantum computing leverages quantum mechanics (superposition and entanglement) to operate across expanded, non-binary multi-state properties simultaneously.

  • Impact on Contemporary Cryptographic Algorithms:

    • Quantum algorithms process prime number factorization at exponentially accelerated computational speeds relative to classical processors.

    • Obsolescence of RSA: Because RSA's cryptographic resilience relies entirely on the mathematical intractability of factoring large composite numbers into prime components, the deployment of stable quantum computing algorithms capable of trivial prime factorization will render RSA obsolete.

    • Wider Cryptographic Disruption: Widespread adoption of practical quantum systems is anticipated to similarly degrade or obsolete multiple established asymmetric and symmetric cryptosystems, necessitating next-generation post-quantum mathematical countermeasures.