Professional Documents
Culture Documents
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
• Stream cipher processes the input elements (1 bit or one units larger than 1 byte)
continuously.
Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Block vs Stream Ciphers
Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Stream Cipher Structure
Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Stream Cipher Properties
• 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
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
Sunway University | NET3106 Network Security | Houshyar Honar Pajooh | Aug 2022
SENSITIVE
Steps in RC4
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