Nothing Special   »   [go: up one dir, main page]

INS WK 12 Lec 23 24

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Information Security (CS-497)

Dr. Qamar Mahmood email: qamar@biit.edu.pk WhatsApp 03335125872

Week 12
Objectives: Learning objectives of this lecture are

• AES algorithm Key Expansion.


• Block Cipher Modes of Operation, Public Key Cryptography
Textbook & Resources:
I. Computer Security: Principles and Practice. 3rd Edition by William Stalling
II. Principles of Information Security 6th Edition by M. Whitman and H. Mattord

Review of Last Week


• AES algorithm Concepts.
• AES Round Operations.

AES Key Expansion

The AES key expansion algorithm takes as input a four-word (16-byte) key and produces a linear
array of 44 words (176 bytes). This is sufficient to provide a four-word round key for the initial
AddRoundKey stage and each of the 10 rounds of the cipher. The pseudocode on the next page
describes the expansion. The key is copied into the first four words of the expanded key. The
remainder of the expanded key is filled in four words at a time. Each added word w[i] depends on
the immediately preceding word, w[i - 1] , and the word four positions back, w[i - 4] . In three
out of four cases, a simple XOR is used. For a word whose position in the w array is a multiple of
4, a more complex function is used. Figure 5.9 illustrates the generation of the expanded key,
using the symbol g to represent that complex function. The function g consists of the following
subfunctions.
Information Security (CS-497)
Dr. Qamar Mahmood email: qamar@biit.edu.pk WhatsApp 03335125872

• rd
performs a one-byte circular left shift on a word. This means that an input word [B 0 , B 1 , B 2
, B 3 ] is transformed into [B 1 , B 2 , B 3 , B 0 ] .
• SubWord performs a byte substitution on each byte of its input word, using the S-box.

• The result of steps 1 and 2 is XORed with a round constant, Rcon[j] .

The round constant is a word in which the three rightmost bytes are always 0.Thus, the effect of an
XOR of a word with Rcon is to only perform an XOR on the left-most byte of the word. The round
constant is different for each round and is defined as Rcon[j] = (RC[j], 0, 0, 0) , with RC[1] = 1 ,
RC[j] = 2 RC[j-1] and with multiplication defined over the field GF(2^ 8 ) . The values of RC[j] in
hexadecimal are
Information Security (CS-497)
Dr. Qamar Mahmood email: qamar@biit.edu.pk WhatsApp 03335125872

Cipher Block Modes of Operation:

Electronic Code Book Mode:

The simplest mode is the electronic codebook (ECB) mode, in which plaintext is handled one
block at a time and each block of plaintext is encrypted using the same key (Figure 6.3). The term
codebook is used because, for a given key, there is a unique ciphertext for every b-bit block of
plaintext. Therefore, we can imagine a gigantic codebook in which there is an entry for every
possible b-bit plaintext pattern showing its corresponding ciphertext.

Cipher Block Chaining Mode:

To overcome the security deficiencies of ECB, we would like a technique in which the same
plaintext block, if repeated, produces different ciphertext blocks. A simple way to satisfy this
requirement is the cipher block chaining (CBC) mode (Figure 6.4). In this scheme, the input to the
encryption algorithm is the XOR of the current plaintext block and the preceding ciphertext block;
the same key is used for each block. In effect, we have chained together the processing of the
sequence of

plaintext blocks. The input to the encryption function for each plaintext block bears no fixed
Information Security (CS-497)
Dr. Qamar Mahmood email: qamar@biit.edu.pk WhatsApp 03335125872
relationship to the plaintext block. Therefore, repeating patterns of b bits are not exposed. As with
the ECB mode, the CBC mode requires that the last block be padded to a full b bits if it is a partial
block.

Counter Mode:

Although interest in the counter (CTR) mode has increased recently with applications to ATM
(asynchronous transfer mode) network security and IP sec (IP security), this mode was proposed
early on (e.g., [DIFF79]). Figure 6.7 depicts the CTR mode. A counter equal to the plaintext block
size is used. The only requirement stated in SP 800-38A is that the counter value must be different
for each plaintext block that is encrypted. Typically, the counter is initialized to some value and
then incremented by 1 for each subsequent block (modulo 2b, where b is the block size). For
encryption, the counter is encrypted and then XORed with the plaintext block to produce the
ciphertext block; there is no chaining. For decryption, the same sequence of counter values is used,
Information Security (CS-497)
Dr. Qamar Mahmood email: qamar@biit.edu.pk WhatsApp 03335125872
with each encrypted counter XORed with a ciphertext block to recover the corresponding plaintext
block.

--------------- X -------------

You might also like