0% found this document useful (0 votes)
63 views26 pages

Lecture 6 - Week 6

This document discusses modes of operation for block ciphers and stream ciphers. It describes the Electronic Code Book (ECB) mode and its weaknesses. It then covers other block cipher modes like Cipher Block Chaining (CBC), Cipher Feedback (CFB), Output Feedback (OFB), and Counter (CTR) modes. The document also discusses stream ciphers, pseudorandom number generation, and the RC4 stream cipher algorithm.

Uploaded by

Vishwa Moorthy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views26 pages

Lecture 6 - Week 6

This document discusses modes of operation for block ciphers and stream ciphers. It describes the Electronic Code Book (ECB) mode and its weaknesses. It then covers other block cipher modes like Cipher Block Chaining (CBC), Cipher Feedback (CFB), Output Feedback (OFB), and Counter (CTR) modes. The document also discusses stream ciphers, pseudorandom number generation, and the RC4 stream cipher algorithm.

Uploaded by

Vishwa Moorthy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

NET3106 – Network Security

Lecturer:
Houshyar Honar Pajooh
Room Number : AE-3-28 (University Building - East)
Email: houshyarh@sunway.edu.my

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
NET3106 – Network Security
WEEK (6)
Modes of operation for block Cipher and
stream cipher

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Modes of
operation for
block Cipher
and stream
cipher
• Modes of Operation for Block Cipher
• Stream Cipher
• RC4

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Need for Modes of Block Ciphers
• Block Ciphers deal with blocks of data
• In real life there are two important issues:
• plaintext much larger than a typical block length of 128 bits
• plaintext not a multiple of the block length
• These modes were first standardized in FIPS Publication 81 in 1980
• The obvious solution is the first mode, called the Electronic Code Book (ECB)

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Electronic Code Book Mode (ECB)

• When a block cipher is used in ECB mode, each block of plaintext is coded independently
• This makes it not very secure for long segments of plaintext, especially plaintext containing repetitive information.
• Used primarily for secure transmission of short pieces of information, such as an encryption key.

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
ECB Example

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
CBC (Cipher-Block Chaining) Mode

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Cipher
Feedback Mode
(CFB)

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Output Feedback Mode (OFB)

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Counter Mode (CTR)

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
• Many uses of random numbers in cryptography
• Generation of keys for the RSA public-key encryption (asymmetric
encryption)
• Generation of key stream for symmetric stream cipher
Random • Generation of symmetric key as temporary session key
• In key distribution scenarios (Kerberos to prevent from reply attack)
Numbers
• In all cases its critical that these values be
• Unpredictability (statistically random)
• Randomness (uniform distribution (same frequency of zeros and ones),
independent)

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
• Often use deterministic algorithmic techniques to create random numbers.
• Not truly random
Pseudorandom • But it can pass many tests of randomness
• Known as pseudorandom numbers
Number
Generators Created by Pseudorandom Number Generators (PRNGs).

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
• True random number generator (TRNG) : input is a random value
(system time).
• Pseudorandom number generator (PRNG) : input is a fixed value +
feedback
Pseudorandom • Pseudorandom function (PRF) : input is a fixed value + feedback +
specific value (e.g. user ID)
Number
Generators

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Stream Cipher

• Block cipher processes one block of elements at a time.

• Stream cipher processes the input elements (1 bit or one units larger than 1 byte)
continuously.

• RC4 is the most popular symmetric stream cipher.

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Block vs Stream Ciphers

• Blocks Ciphers process plaintext in large blocks.


• Stream Ciphers process plaintext in small blocks, even bits
• Block cipher are considered more secure than stream cipher
• Stream cipher are faster than block cipher

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Stream Cipher Structure

• The key is input to pseudorandom byte generator.


• The key is unpredictable.
• The output of pseudorandom byte generator is called keystream.
• Keystream will combine with plaintext stream using XOR.
• E.g. :
• En :11001100 plaintext 01101100 Keystream = 10100000 Ciphertext
• De : 10100000 Ciphertext 01101100 Keystream = 11001100 plaintext

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Stream Cipher Properties

• Some design considerations are:


• long period with no repetitions
• statistically random
• depends on large enough key, e.g. 128 bits

• Properly designed, can be as secure as a block cipher with same size key
• But usually simpler & faster
• Data communication channel and web : stream cipher
• File transferring, email and database : block cipher

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
RC4

• Its stream cipher


• Encrypt one bytes at a time
• Can use as a random number generator
• Very fast and simple
• Popular method, including WEP, WPA and SSL
• RC4 generates a pseudorandom stream of bits (a keystream) which, for encryption/decryption, is combined
with the plaintext using XOR
• Key size 1~256 bytes (8 to 2048 bits)
• Inputs: Key and Data
• Output: Unique keystream equal to the length of input data

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
• Contain Key Scheduling Algorithm (KSA) and Pseudorandom Generation Algorithm (PRGA) steps:

RC4 Structure

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Main functions in RC4

• Key scheduling algorithm (KSA):


◦ A variable length key, between 40 and 256 bits, is used to initialize the 256-byte state vector (S) (permutation)

• Pseudo Random Generation Algorithm (PRGA)


◦ To generate the keystream

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Steps in RC4

• The steps for RC4 encryption algorithm is as follows:


◦ Get the data to be encrypted and the selected key.
◦ Create two string arrays.
◦ Initiate one array with numbers from 0 to 255.
◦ Fill the other array with the selected key.
◦ Randomize the first array depending on the array of the key.
◦ Randomize the first array within itself to generate the final key stream.
◦ XOR the final key stream with the data to be encrypted to give cipher text.

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
RC4 Example

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Thank you Questions!!!

Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy