Spring 2010: CS419 Computer Security Vinod Ganapathy Lecture 3 - - PowerPoint PPT Presentation

spring 2010 cs419
SMART_READER_LITE
LIVE PREVIEW

Spring 2010: CS419 Computer Security Vinod Ganapathy Lecture 3 - - PowerPoint PPT Presentation

Spring 2010: CS419 Computer Security Vinod Ganapathy Lecture 3 Material from Chapter 2 in textbook and Lecture 2 handout (Chapter 8, Bishops book) Slides adapted from Matt Bishop, William Stallings and Lawrie Brown Modern Block Ciphers


slide-1
SLIDE 1

Spring 2010: CS419

Computer Security

Vinod Ganapathy Lecture 3

Material from Chapter 2 in textbook and Lecture 2 handout (Chapter 8, Bishop’s book) Slides adapted from Matt Bishop, William Stallings and Lawrie Brown

slide-2
SLIDE 2

Modern Block Ciphers

  • now look at modern block ciphers
  • one of the most widely used types of

cryptographic algorithms

  • provide secrecy /authentication services
  • focus on DES (Data Encryption Standard)
  • to illustrate block cipher design principles
slide-3
SLIDE 3

Block vs Stream Ciphers

  • block ciphers process messages in blocks,

each of which is then en/decrypted

  • like a substitution on very big characters

– 64­bits or more

  • stream ciphers process messages a bit or

byte at a time when en/decrypting

  • many current ciphers are block ciphers
  • broader range of applications
slide-4
SLIDE 4

Block Cipher Principles

  • most symmetric block ciphers are based on a

Feistel Cipher Structure

  • needed since must be able to decrypt ciphertext to

recover messages efficiently

  • block ciphers look like an extremely large

substitution

  • would need table of 264 entries for a 64­bit block
  • instead create from smaller building blocks
  • using idea of a product cipher
slide-5
SLIDE 5

Ideal Block Cipher

slide-6
SLIDE 6

Claude Shannon and Substitution­ Permutation Ciphers

  • Claude Shannon introduced idea of substitution­

permutation (S­P) networks in 1949 paper

  • form basis of modern block ciphers
  • S­P nets are based on the two primitive

cryptographic operations seen before:

– substitution (S­box) – permutation (P­box)

  • provide confusion & diffusion of message & key
slide-7
SLIDE 7

Confusion and Diffusion

  • cipher needs to completely obscure

statistical properties of original message

  • a one­time pad does this
  • more practically Shannon suggested

combining S & P elements to obtain:

  • diffusion – dissipates statistical structure of

plaintext over bulk of ciphertext

  • confusion – makes relationship between

ciphertext and key as complex as possible

slide-8
SLIDE 8

Feistel Cipher Structure

  • Horst Feistel devised the feistel cipher

– based on concept of invertible product cipher

  • partitions input block into two halves

– process through multiple rounds which – perform a substitution on left data half – based on round function of right half & subkey – then have permutation swapping halves

  • implements Shannon’s S­P net concept
slide-9
SLIDE 9

Feistel Cipher Structure

slide-10
SLIDE 10

Feistel Cipher Design Elements

  • block size
  • key size
  • number of rounds
  • subkey generation algorithm
  • round function
  • fast software en/decryption
  • ease of analysis
slide-11
SLIDE 11

Feistel Cipher Decryption

slide-12
SLIDE 12

Data Encryption Standard (DES)

  • most widely used block cipher in world
  • adopted in 1977 by NBS (now NIST)

– as FIPS PUB 46

  • encrypts 64­bit data using 56­bit key
  • has widespread use
  • has been considerable controversy over its

security

slide-13
SLIDE 13

DES History

  • IBM developed Lucifer cipher

– by team led by Feistel in late 60’s – used 64­bit data blocks with 128­bit key

  • then redeveloped as a commercial cipher

with input from NSA and others

  • in 1973 NBS issued request for proposals

for a national cipher standard

  • IBM submitted their revised Lucifer which

was eventually accepted as the DES

slide-14
SLIDE 14

Overview of the DES

  • A block cipher:

– encrypts blocks of 64 bits – outputs 64 bits of ciphertext

  • A product cipher

– basic unit is the bit – performs both substitution and transposition (permutation) on the bits

  • Cipher consists of 16 rounds (iterations) each with

a round key generated from the user­supplied key

slide-15
SLIDE 15

Generation of Round Keys

key PC­1 C0 D0 LSH LSH D1 PC­2 K1 K16 LSH LSH C1 PC­2

  • Round keys are 48 bits

each

slide-16
SLIDE 16

DES Key Schedule

  • forms subkeys used in each round

– initial permutation of the key (PC1) which selects 56­bits in two 28­bit halves – 16 stages consisting of:

  • rotating each half separately either 1 or 2 places

depending on the key rotation schedule K

  • selecting 24­bits from each half & permuting them

by PC2 for use in round function F

  • note practical use issues in h/w vs s/w
slide-17
SLIDE 17

Encipherment

input IP L0 R0

f K1 L1 = R0 R1 = L0 ⊕ f(R0, K1) R16 = L15 ­ f(R15, K16 ) L16 = R15 IPĞ1

  • utput
slide-18
SLIDE 18

Initial Permutation IP

  • first step of the data computation
  • IP reorders the input data bits
  • even bits to LH half, odd bits to RH half
  • quite regular in structure (easy in h/w)
  • example:

IP(675a6967 5e5a6b5a) = (ffb2194d 004df6fb)

slide-19
SLIDE 19

DES Round Structure

  • uses two 32­bit L & R halves
  • as for any Feistel cipher can describe as:

Li = Ri–1 Ri = Li–1 ⊕ F(Ri–1, Ki)

  • F takes 32­bit R half and 48­bit subkey:

– expands R to 48­bits using perm E – adds to subkey using XOR – passes through 8 S­boxes to get 32­bit result – finally permutes using 32­bit perm P

slide-20
SLIDE 20

The f Function

slide-21
SLIDE 21

DES Decryption

  • decrypt must unwind steps of data computation
  • with Feistel design, do encryption steps again

using subkeys in reverse order (SK16 … SK1)

– IP undoes final FP step of encryption – 1st round with SK16 undoes 16th encrypt round – …. – 16th round with SK1 undoes 1st encrypt round – then final FP undoes initial encryption IP – thus recovering original data value

slide-22
SLIDE 22

Strength of DES – Key Size

  • 56­bit keys have 256 = 7.2 x 1016 values
  • brute force search looks hard
  • recent advances have shown is possible

– in 1997 on Internet in a few months – in 1998 on dedicated h/w (EFF) in a few days – in 1999 above combined in 22hrs!

  • still must be able to recognize plaintext
  • must now consider alternatives to DES
slide-23
SLIDE 23

Strength of DES – Analytic Attacks

  • now have several analytic attacks on DES
  • these utilize some deep structure of the cipher

– by gathering information about encryptions – can eventually recover some/all of the sub­key bits – if necessary then exhaustively search for the rest

  • generally these are statistical attacks
  • include

– differential cryptanalysis – linear cryptanalysis – related key attacks

slide-24
SLIDE 24

Strength of DES – Timing Attacks

  • attacks actual implementation of cipher
  • use knowledge of consequences of

implementation to derive information about some/all subkey bits

  • specifically use fact that calculations can

take varying times depending on the value

  • f the inputs to it
  • particularly problematic on smartcards
slide-25
SLIDE 25

Differential Cryptanalysis

  • A chosen ciphertext attack

– Requires 247 plaintext, ciphertext pairs

  • Revealed several properties

– Small changes in S­boxes reduce the number of pairs needed – Making every bit of the round keys independent does not impede attack

slide-26
SLIDE 26

Differential Cryptanalysis

  • one of the most significant recent (public)

advances in cryptanalysis

  • known by NSA in 70's
  • Murphy, Biham & Shamir published in 90’s
  • powerful method to analyse block ciphers
  • used to analyse most current block ciphers

with varying degrees of success

slide-27
SLIDE 27

Differential Cryptanalysis

  • have some input difference giving some
  • utput difference with probability p
  • if find instances of some higher probability

input / output difference pairs occurring

  • can infer subkey that was used in round
  • then must iterate process over many rounds

(with decreasing probabilities)

slide-28
SLIDE 28

DES Modes

  • Electronic Code Book Mode (ECB)

– Encipher each block independently

  • Cipher Block Chaining Mode (CBC)

– Xor each block with previous ciphertext block – Requires an initialization vector for the first one

  • Encrypt­Decrypt­Encrypt Mode (2 keys: k, k′)

– c = DESk(DESk′

–1(DESk(m)))

  • Encrypt­Encrypt­Encrypt Mode (3 keys: k, k′, k′′)

– c = DESk(DESk′ (DESk′′(m)))

slide-29
SLIDE 29

CBC Mode Encryption

  • init. vector

m1 DES c1

m2 DES c2 sent sent … … …

slide-30
SLIDE 30

CBC Mode Decryption

  • init. vector

c1 DES m1 … … …

c2 DES m2

slide-31
SLIDE 31

Self­Healing Property

  • Initial message

– 3231343336353837 3231343336353837 3231343336353837 3231343336353837

  • Received as (underlined 4c should be 4b)

– ef7c4cb2b4ce6f3b f6266e3a97af0e2c 746ab9a6308f4256 33e60b451b09603d

  • Which decrypts to

– efca61e19f4836f1 3231333336353837 3231343336353837 3231343336353837

– Incorrect bytes underlined – Plaintext “heals” after 2 blocks

slide-32
SLIDE 32

Current Status of DES

  • Design for computer system, associated software

that could break any DES­enciphered message in a few days published in 1998

  • Several challenges to break DES messages solved

using distributed computing

  • NIST selected Rijndael as Advanced Encryption

Standard, successor to DES

– Designed to withstand attacks that were successful on DES

slide-33
SLIDE 33

Next topic: Public­key cryptography

slide-34
SLIDE 34

Public­Key Cryptography (PKC)

  • Two keys

– Private key known only to individual – Public key available to anyone

  • Public key, private key inverses
  • Idea

– Confidentiality: encipher using public key, decipher using private key – Integrity/authentication: encipher using private key, decipher using public one

  • Proposed by Whitfield Diffie and Martin Hellman

in 1976

slide-35
SLIDE 35

Examples of PKC

  • Diffie-Hellman cryptosystem
  • RSA cryptosystem
  • Both are based upon certain functions that

are

– Easy to compute – Difficult to invert

  • Example: factoring a large number
slide-36
SLIDE 36

RSA

  • Invented in 1978 by Rivest, Shamir, Adleman
  • Won Turing Award in 2002
  • Uses surprisingly elementary number theory