Docsity

Block Ciphers - Cryptography - Lecture Slides, Slides of Cryptography and System Security

Partial preview of the text

Download Block Ciphers - Cryptography - Lecture Slides and more Slides Cryptography and System Security in PDF only on Docsity!

Block Ciphers

2

Modern Ciphers

Modern ciphers considered successful if all (publicly) known cryptanalytic techniques cannot succeed with better complexity than a brute-force key search.

Data Encryption Standard (DES)

successful relative 56-bit key

CPA-resistant relative 55-bit key

key-size now too small - “retired”

Advanced Encryption Standard (AES)

key-sizes 128, 192, and 256 bits

4

Pseudocode

INPUT: plaintext x , key K OUTPUT: ciphertext y = ASSUMED: round function g , last round h , key scheduling procedure giving for i = 1 to

eK ( x )

Nr − 1

K

i

w

0

= x

w

i

= g ( w

i − 1

, K

i

y = g ( w

Nr − 1

, K

Nr − 1

5

Substitutions

A substitution is a pre-defined random- looking function from length l bitstrings to length k bitstrings

Stinson defines l=k and insists that the function be bijective - I won’t

Defined using S-boxes on substrings of input - so very efficient in hardware

Notation

S-box:

Resulting substitution:

! S

!( w ) = " S ( w

( 1 )

)‖" S ( w

( 2 )

)‖ · · · ‖" S ( w

( m )

7

Substitution

Permutation Network

Define substitution from predefined S-box

Predefined permutation

Round function:

Final round - no permutation + whitening:

g ( w , K

i

) =! ◦ "( w ⊕ K

i

h ( w , K ) = !( w ⊕ K

Nr − 1

) ⊕ K

Nr

8

Feistel Network - DES

Each round breaks intermediate ciphertext into left and right halves

Expansion applied near start of round

Contracting substitution applied mid-round

Permutation applied near end of round

Round function:

Beginning and end slightly different

Apply “initial permutation” IP at start

Apply swap and at end (no key):

w

i

w

i L

, w

i R

NR = 16

g ( w , K

i

) = wR ‖ wL ⊕ !("(#( wR ) ⊕ K

i

IP

− 1

h ( w ) = IP

− 1

( wR ‖ wL )

10

Modes of Operation

ECB - Electronic Code Book

Name for doing nothing after encrypting

Fails message-indistinguishibility

Motivates need for randomization in other three modes

Technically, CBC, CFB, OFB are “stream” ciphers

11

CBC

Cipher Block Chaining

First block = rand. initialization vector (IV)

Cipher block formula:

y 0

yi = eK ( yi − 1 ⊕ xi )