Cryptography and Network Security Lecture 2
Cryptography and Network Security Lecture 2
Cryptography and
Modern cryptography | Feistel
Network Security structure and DES
Block Ciphers : Encrypt data in fixed-size blocks (like 64 ,128, or 256 bits), use complex transformations
(Example are: DES and AES). More suited for hardware implementations, are more resilient to transmission
errors, and are ideal for encrypting large amounts of data.
Stream Ciphers : Encrypt data bit by bit or byte by byte, generating a keystream that is combined with the
plaintext. Examples include RC4 and Salsa20. Stream ciphers are often faster, use less memory, are more suited
for software implementations, and are ideal for real-time or streaming applications.
Stream Ciphers
• Subkeys: Each round uses a different subkey derived from the main key.
• Processing: Involves mixing one half with a subkey and then combining it with the other half.
• Reversibility: Designed to be easily reversible for decryption with the correct key.
• Usage: Utilized in many encryption algorithms, including DES, Blowfish, and Twofish.
Fiestel structure
• Block and Key Lengths: The Feistel Cipher works with blocks of data of a certain bit length (n-
bit). The key length can vary, and it's not directly tied to the number of transformations or
• Operations - Substitution and Transposition: The cipher typically involves a series of rounds
These operations are part of the round function, which is applied to one half of the data block.
• Diffusion and Confusion Principles: The design of the Feistel Cipher employs the principles
of diffusion (spreading the influence of the plaintext and key throughout the ciphertext) and
confusion (obscuring the relationship between the ciphertext and the plaintext/key).
Fiestel structure
Typical Approach:
• Generating Subkeys: Each round of the encryption process uses a subkey derived from
• Round Function Application: A round function, F, is applied to one half of the data
• Combining with XOR: The output of the round function is combined with the other half
• Swapping Halves: After each round, the two halves of the data are swapped. This process
Implementation: In Feistel Ciphers, confusion is typically achieved through the use of complex
substitution algorithms in the round function. These substitutions are non-linear and often involve S-
boxes (substitution boxes) or other non-linear transformations. These complex operations obscure the
direct relationship between the key and the ciphertext, making it hard to perform cryptanalysis or
reverse-engineer the key from the ciphertext.
Fiestel structure
Fiestel structure
S-DES Operations
I P10 (permutate)
Input : 1 2 3 4 5 6 7 8 9 10
Output: 3 5 2 7 4 10 1 9 8 6
I P4 (permutate)
Input : 1 2 3 4
Output: 2 4 3 1
Simplified DES (S-DES)
S-DES Operations
➢ EP (expand and permutate)
Input : 1 2 3 4
Output: 4 1 2 3 2 3 4 1
➢ IP (initial permutation)
Input : 1 2 3 4 5 6 7 8
Output: 2 6 3 1 4 8 5 7
➢ Plaintext: 01110010
➢ Key: 1010000010
➢ Ciphertext: 01110111
S-DES Example
S-DES Example
S-DES