Untitled
Week 3 Cryptography Concepts – Part 1
Introduction to Cryptography
Course: INTE2625/65 Introduction to Cyber Security
CRICOS provider number: 00122A | RTO Code: 3046
Topics Covered
Section 1: Basics of Cryptography
Section 2: Classical Ciphers
Section 3: Modern Ciphers
- One-Time Pad
- Block ciphers
- Data Encryption Standard (DES)
- Block Cipher Modes:
- Electronic Codebook Mode (ECB)
- Cipher Block Chaining Mode (CBC)
- Cipher Feedback Mode (CFB)
- Counter Mode (CTR)
Basics of Cryptography
Definition:
- Cryptography is the process of hiding or coding information such that only the intended recipient can read it.Key concepts include:
- Alice: Sender
- Bob: Receiver
- Trudy: Opponent (Eavesdropper)
- Insecure Channel: Public Network
Recap of Network Security Model
Sender:
- Along with encryption and security-related transformation of the secret information.Opponents:
- Intercept the message during transmission.Messages undergo a secure transformation and are sent to the Recipient.
Cryptography Model Explained
Encryption Process: Sender encrypts the Message using a Secret Code.
Decryption Process: Recipient decrypts the message back into its original form using the same or different secret code, depending on the encryption method utilized.
Cryptography Ingredients
Five main ingredients in cryptography:
1. Plaintext: Original representation of the information.
2. Encryption Algorithm: Hides or obscures plaintext.
3. Ciphertext: Encrypted output generated by an encryption algorithm.
4. Decryption Algorithm: Recovers plaintext from ciphertext.
5. Key: Secret code utilized by both encryption and decryption algorithms to ensure security.
- Encryption Key: Used during the encryption process.
- Decryption Key: Used during the decryption process.Important Principle: Security depends on the secrecy of the key, not the secrecy of the algorithm itself.
Encryption Types
Two Major Types of Encryption Techniques:
- Symmetric Key Encryption:
- Also known as Secret Key encryption.
- Condition: Encryption Key = Decryption Key.
- Asymmetric Key Based Encryption:
- Also known as Public Key encryption.
- Condition: Encryption Key ≠ Decryption Key.
Symmetric Key Encryption
Involves a shared secret key between sender and receiver.
The process can be represented as:
- For a plaintext/message (M), secret key (K), Encryption Algorithm E,
- Ciphertext (C) can be expressed as:
.Examples of symmetric key encryption: Ciphers, AES, DES, 3-DES, etc.
Classical Ciphers
Primarily utilize symmetric key encryption and include:
- Caesar Cipher: Used by Julius Caesar around 58 BC.
- Enigma Machine: Used by Germany during WWII.
- Types of operations in Classical Ciphers:
1. Substitution
2. Transposition
Substitution Ciphers
Substitute letters systematically with other letters.
- Example of a Caesar Cipher:
- Substitute each letter with another letter that is two positions down in the English alphabet:
- Key k = 2:
- Plaintext: "message"
- Ciphertext: "oguucig"
- For k = 3:
- Plaintext: "message"
- Ciphertext: "phvvdjh"
Transposition Ciphers
Rearrange positions of letters in the message based on rules; the value of letters does not affect their position.
- Example:
- Move each letter in "message" by 1 position:
- Plaintext: "message"
- Ciphertext: "emessag"
Modern Ciphers
Focus on more advanced encryption methods such as:
- One-Time Pad:
- Requires a key made of randomly selected bits that is the same length as the message.
- The key is XORed with the plaintext to produce ciphertext.
- The encryption and decryption mechanism can be expressed as:
- Encryption:
- Decryption:
Block Ciphers
Commonly used symmetric encryption algorithms that process plaintext in fixed-sized blocks, producing ciphertext blocks of the same size.
Components involved:
- Inputs:
- Plaintext block P of length n bits.
- Secret key K of length k bits.
- Output:
- Ciphertext block C of length n bits.
- Representation of the algorithm:
-Example: Feistel Block design with characteristics like block size, key size, multiple rounds, etc.
Feistel Cipher Design Elements
Factors affecting security and performance:
- Block Size: Larger block sizes enhance security but may reduce speed.
- Key Size: Larger key sizes increase security but may reduce speed.
- Number of Rounds: More rounds boost security.
- Complexity: Higher complexity generally leads to increased resistance to cryptanalysis.
- Ease of Analysis: Simplicity allows for better cryptanalytic assessment.
Symmetric Block Encryption Algorithms
Most important symmetric block ciphers include:
- Data Encryption Standard (DES)
- Triple DES (3DES)
- Advanced Encryption Standard (AES)
Data Encryption Standard (DES)
Description:
- First issued in 1977 as Federal Information Processing Standard 46 (FIPS 46) by NIST.
- Plaintext: 64 bits in length.
- Key: 56 bits in length.
- Constructs a modified Feistel network with 16 rounds.
Weaknesses of DES
Concerns centered around:
- Analysis exploitations.
- The inadequacy of a 56-bit key against modern computational power.
- Speed of standard processors challenges security levels.
Cracking DES
DES was demonstrated to be insecure:
- Cracked by the EFF (Electronic Frontier Foundation) using a distributed effort in 1998.Resulted in the conclusion that DES is obsolete.
Triple DES (3DES)
Standardized for financial applications in 1985.
Involves an Encrypt-Decrypt-Encrypt (EDE) sequence.
Utilizes 3 distinct keys, giving 3DES an effective key length of 168 bits.
Random and Pseudorandom Numbers
Many network security algorithms utilize random numbers for various purposes:
- Key generation for public-key encryption algorithms (e.g., RSA).
- Generation of symmetric keys for session-based applications.Critical for handshaking processes to avoid replay attacks.
Quality of Randomness
Two distinct requirements for random number sequences:
1. Randomness: Uniform distribution of bits, no predictable patterns.
2. Unpredictability: Each number should not be deducible from previous numbers.
Pseudorandom Number Generators (PRNG)
True Random Number Generator (TRNG): Utilizes genuinely random sources (e.g., physical phenomena).
Pseudorandom Number Generator (PRNG): Generates sequences of bits that appear random but are generated algorithmically.
Pseudorandom Function (PRF): Produces fixed-length random strings from specific inputs.
Cipher Block Modes of Operation
Symmetric block ciphers typically handle data in fixed blocks (e.g., DES and 3DES operate on 64 bits, while AES typically uses 128 bits).
For longer plaintexts, it must be segmented into appropriately sized blocks, with padding if necessary.
NIST has defined four primary modes of operation intended for various applications of block ciphers:
- Electronic Codebook Mode (ECB)
- Cipher Block Chaining Mode (CBC)
- Cipher Feedback Mode (CFB)
- Counter Mode (CTR)
Important Cipher Block Modes
Electronic Codebook Mode (ECB)
- Encrypts each block independently; identical plaintext blocks yield identical ciphertext blocks, potentially revealing patterns in long messages.Cipher Block Chaining Mode (CBC)
- Integrates plaintext and ciphertext blocks, adding an initialization vector (IV) for security.
- Process involves XORing plaintext with the previous ciphertext before encryption.Cipher Feedback Mode (CFB)
- Similar to CBC but designed to function as a stream cipher.Counter Mode (CTR)
- Uses a counter mechanism to produce ciphertext, allowing for greater efficiency and flexibility.
Assignments and Discussions
Questions or discussions may arise from the material presented in Week 3.
End of Week 3 Lecture
Any questions or clarifications needed should be addressed at this stage.