L8L10 2
L8L10 2
Encryption Standard
(Class-L8, L18, L9,L10 )
Algorithm Types
It defines what size of plain text
should be encrypted in each step of
algorithm
Stream Cipher
Block Cipher
Stream Cipher
Plaintext is encrypted one bit at a time
Suppose message is Pay 101 in ASCII
In binary it can be a series of 1 and 0;
Every bit will be applied with a encryption
algorithms
Let Say binary data is 10010101
Apply XOR with a key operation will get a cipher
text
Block Ciphers
A block of bits is encrypted at one go
Suppose a plaint text is
FOUR_AND_FOUR
It can be encrypted in blocks of
FOUR, _AND_, and FOUR
How to use a block cipher?
Block ciphers encrypt fixed size blocks
E.g. DES encrypts 64-bit blocks
We need some way to encrypt a message of
arbitrary length
E.g. a message of 1000 bytes
NIST defines five ways to do it
Called modes of operations
5
Algorithm Modes (L18)
It is a combination of a series of the
basic algorithm steps on block cipher
and kind of feedback from the
previous steps
Five Modes of Operation
Electronic codebook mode (ECB)
Cipher block chaining mode (CBC) most
popular
Output feedback mode (OFB)
Cipher feedback mode (CFB)
Counter mode (CTR)
7
Electronic Code Book
(ECB)
The plaintext is broken into blocks, P
1
, P
2
, P
3
, ...
Each block contains 64 bits each
Each block is encrypted independently of the other
blocks
For all blocks in a message, the same key is used
for encryption
At the Receiver end, the incoming data is divided
into 64-bit blocks and used the same key for
decryption
8
Remarks on ECB
Strength: its simple.
Weakness:
Repetitive information contained in the
plaintext may show in the ciphertext, if
aligned with blocks.
If the same message (e.g., an SSN) is
encrypted (with the same key) and sent
twice, their cipher texts are the same.
Typical application: secure transmission of
short pieces of information
9
Cipher Block Chaining
(CBC)
( )
( )
1 2 3
1
The plaintext is broken into blocks: , , , ...
Each plaintext block is XORed chained with the previous
ciphertext block before encryption (hence the name):
E
i K i i
P P P
C C P
-
-
=
( )
0
1
IV
Use an Initial Vector IV to start the process.
Decryption : D ( )
Application : general block-oriented transmission.
i i K i
C
P C C
=
-
- =
-
10
Cipher Block Chaining (CBC)
11
Remarks on CBC
The encryption of a block depends on the
current and all blocks before it.
So, repeated plaintext blocks are encrypted
differently.
Initialization Vector (IV)
Must be known to both the sender & receiver
Typically, IV is either a fixed value or is sent
encrypted in ECB mode before the rest of
ciphertext.
12
13
Cipher feedback mode (basic
version)
Plaintext blocks: p
1
, p
2
,
Key: k
Basic idea: construct key stream k
1
, k
2
, k
3
,
Encryption:
0
1
IV
( ), for 1
, for 1
i k i
i i i
c
k E c i
c p k i
= >
= >
= >
= >