Lecture 3 Encryption Suggested Readings: Chs 3 & 4 in KPS - - PowerPoint PPT Presentation

lecture 3
SMART_READER_LITE
LIVE PREVIEW

Lecture 3 Encryption Suggested Readings: Chs 3 & 4 in KPS - - PowerPoint PPT Presentation

Lecture 3 Encryption Suggested Readings: Chs 3 & 4 in KPS (recommended) Ch 3 in Stinson (optional) 1 Encryp Enc yption n Princ ncipl ples A cryptosystem has (at least) five ingredients: Plaintext Secret Key


slide-1
SLIDE 1

Lecture 3

Encryption

Suggested Readings:

  • Chs 3 & 4 in KPS (recommended)
  • Ch 3 in Stinson (optional)

1

slide-2
SLIDE 2

2

  • A cryptosystem has (at least) five ingredients:

– Plaintext – Secret Key – Ciphertext – Encryption Algorithm – Decryption Algorithm

  • Security usually depends on the secrecy of the

key, not the secrecy of the algorithms

Enc Encryp yption n Princ ncipl ples

slide-3
SLIDE 3

3

Cr Cryp ypto Ba Basi sics

slide-4
SLIDE 4

4

Average Ti Time Required fo for Exha Exhaus ustive Ke Key Sear earch (f (for Bru Brute Fo Force Atta ttacks) )

Key Size (bits) Number of Alternative Keys Time required at 106 Decr/µs 32 232 = 4.3 x 109 2.15 milliseconds 56 256 = 7.2 x 1016 10 hours 128 2128 = 3.4 x 1038 5.4 x 1018years 168 2168 = 3.7 x 1050 5.9 x 1030years

slide-5
SLIDE 5

5

Ty Types of Attainable Security

  • Perfect, unconditional or “information theoretic”: the security

is evident free of any (computational/hardness) assumptions

  • Reducible or “provable”: security can be shown to be based on

some common (often unproven) assumptions, e.g., the conjectured difficulty of factoring large integers

  • Ad hoc: the security seems good often -> “snake oil”…

Take a look at:

http://www.ciphersbyritter.com/GLOSSARY.HTM

slide-6
SLIDE 6

6

Co Comp mputational Se Securi rity

  • Encryption scheme is computationally secure if

– cost of breaking it (via brute force) exceeds the value of the encrypted information; or – time required to break it exceeds useful lifetime of the encrypted information

  • Most modern schemes we will see are considered computationally

secure

– Usually rely on very large key-space, impregnable to brute force

  • Most advanced schemes rely on lack of knowledge of effective

algorithms for certain hard problems, not on a proven inexistence

  • f such algorithms (reducible security)!

– Such as: factoring, discrete logarithms, etc.

slide-7
SLIDE 7

7

Cr Cryp yptosystems ms

Classified along three dimensions:

  • Type of operations used for transforming plaintext into

ciphertext

– Binary arithmetic: shifts, XORs, ANDs, etc.

  • Typical for conventional (or symmetric) encryption

– Integer arithmetic

  • Typical for public key (or asymmetric) encryption
  • Number of keys used

– Symmetric or conventional (single key used) – Asymmetric or public key (2 keys: 1 to encrypt, 1 to decrypt)

  • How plaintext is processed:

– One bit at a time – A string of any length – A block of bits

slide-8
SLIDE 8

Co Conventional (S (Symme ymmetri ric) ) Cr Cryp yptography

  • Alice and Bob share a key KAB which they somehow agree

upon (how?)

  • key distribution / key management problem
  • ciphertext is roughly as long as plaintext
  • examples: Substitution, Vernam OTP, DES, AES

8

plaintext ciphertext

K AB

encryption algorithm decryption algorithm

K AB

plaintext m K (m)

AB

K (m)

AB

m = K (

)

AB

slide-9
SLIDE 9

Us Uses es of Conven entio tional al Cryptograp aphy

  • Message Transmission (confidentiality):
  • Communication over insecure channels
  • Secure Storage: crypt on Unix
  • Strong Authentication: proving knowledge of a secret

without revealing it:

  • See next slide
  • Eve can obtain chosen <plaintext, ciphertext> pair
  • Challenge should be chosen from a large pool
  • Integrity Checking: fixed-length checksum for message via

secret key cryptography

  • Send MAC along with the message MAC=H(m,K)

9

slide-10
SLIDE 10

Ch Challenge-Re Response Authentication Ex Exampl ple

10

K AB

challenge

K AB

ra KAB(ra)

challenge reply

rb KAB(rb)

challenge challenge reply

slide-11
SLIDE 11

11

Co Conventional Cr Cryp yptography

Ø Advantages

l high data throughput l relatively short key size l primitives to construct various cryptographic

mechanisms

Ø Disadvantages

l key must remain secret at both ends l key must be distributed securely and efficiently l relatively short key lifetime

slide-12
SLIDE 12
  • Asymmetric Cryptography
  • Invented in 1974-1978 (Diffie-Hellman and Rivest-Shamir-Adleman)
  • Two keys: private (SK), public (PK)
  • Encryption: with public key;
  • Decryption: with private key
  • Digital Signatures: Signing by private key; Verification by public key. i.e.,

“encrypt” message digest/hash -- h(m) -- with private key

  • Authorship (authentication)
  • Integrity: Similar to MAC
  • Non-repudiation: cannot do with secret key cryptography
  • Much slower (~1000x) than conventional cryptography
  • Often used together with conventional cryptography, e.g., to encrypt session keys

12

Pu Public Key Crypto tography

slide-13
SLIDE 13 13

Ge Genesis is of

  • f P

Public Ke Key Cryptography: Dif Diffie ie- Hellm Hellman an Paper aper

slide-14
SLIDE 14

Pu Public Key Crypto tography

14

plaintext message, m ciphertext encryption algorithm decryption algorithm

Bob’s public key

plaintext message PK (m)

B

PK

B

Bob’s private key

SK

B

m = SK (PK (m))

B B

slide-15
SLIDE 15

Us Uses es of Public lic Key Cryptograp aphy

  • Data Transmission (confidentiality):
  • Alice encrypts ma using PKB, Bob decrypts it to obtain ma using

SKb.

  • Secure Storage: encrypt with own public key, later

decrypt with own private key

  • Authentication:
  • No need to store secrets, only need public keys.
  • Secret key cryptography: need to share secret key for every

person one communicates with

  • Digital Signatures (authentication, integrity, non-

repudiation)

15

slide-16
SLIDE 16

16

Ø Advantages

l only the private key must be kept secret l relatively long life time of the key l more security services l relatively efficient digital signatures mechanisms

Ø Disadvantages

l low data throughput l much larger key sizes l distribution/revocation of public keys l security based on conjectured hardness of certain

computational problems

Pu Public Key Crypto tography

slide-17
SLIDE 17

17

Ø Public Key

l Encryption, signatures (esp., non-repudiation) and key

management

Ø Conventional

l Encryption and some data integrity applications

Ø Key Sizes

l Keys in public key crypto must be larger (e.g., 2048 bits for RSA)

than those in conventional crypto (e.g., 112 bits for 3-DES or 256

bits for AES)

  • most attacks on “good” conventional cryptosystems are exhaustive key

search (brute force)

  • public key cryptosystems are subject to “short-cut” attacks (e.g.,

factoring large numbers in RSA)

Co Comp mpari riso son Su Summa mmary

slide-18
SLIDE 18

“M “Moder dern” n” Block Cipher phers Da Data E a Encr cryptio ion S Stan andar ard ( (DE DES)

slide-19
SLIDE 19

Ge Generic ic Ex Exampl mple of

  • f Block

k Encryp yption

20

slide-20
SLIDE 20

Fe Feistel Ci Cipher St Stru ructure

  • Virtually all conventional block encryption algorithms,

including DES, have a structure first described by Horst Feistel of IBM in 1973

  • Specific realization of a Feistel Network depends on the

choice of the following parameters and features:

20

slide-21
SLIDE 21

Fe Feistel Ci Cipher St Stru ructure

  • Block Size: larger block sizes mean greater security
  • Key Size: larger key size means greater security
  • Number of Rounds: multiple rounds offer increasing

security

  • Subkey Generation Algorithm: greater complexity will

lead to greater difficulty of cryptanalysis

  • Fast Software En/De-cryption: speed of execution of

the algorithm becomes a concern

21

slide-22
SLIDE 22

22

Cl Classi ssic Fe Feistel Ne Network

“Round Keys” are generated from

  • riginal key via

subkey generation algorithm

slide-23
SLIDE 23

Bl Block k Ci Ciphers

23

  • Originated with early 1970's IBM effort to develop

banking security systems

  • First result was Lucifer, most common variant has 128-

bit key and block size

  • Was not secure in any of its variants
  • Called a Feistel or product cipher
  • F()-function is a simple transformation, does not have

to be reversible

  • Each step is called a round; the more rounds, the

greater the security (to a point)

  • Most famous example of this design is DES
slide-24
SLIDE 24

Co Conventional Enc Encryp yption St Standard

  • Data Encryption Standard (DES)
  • Most widely used encryption method

(AES is probably taking over by now)

  • Block cipher (in native ECB mode)
  • Plaintext processed in 64-bit blocks
  • Key is 56 bits

24

slide-25
SLIDE 25
  • 64 bit input block
  • 64 bit output block
  • 16 rounds
  • 64 (effective 56) bit key
  • Key schedule computed at startup
  • Aimed at bulk data
  • > 16 rounds does not help
  • > 56 bit key does not help
  • Other S-boxes usually hurt …

Da Data a Enc Encryp yption St Standard (DES) S)

25

slide-26
SLIDE 26

26

Ba Basi sic St Stru ructure of

  • f DE

DES

slide-27
SLIDE 27 27

Enc Encryp yption vs vs De Decr cryptio ion in in DE DES

slide-28
SLIDE 28

64 Bit Plaintext Initial Permutation 32 Bit L0 32 Bit R0 F(R0,K1) + 32 Bit L1 32 Bit R1 32 Bit L15 32 Bit R15 F(R15,K16) + 32 Bit L16 32 Bit R16 Final Permutation 64 Bit Ciphertext

Encryption Process

DE DES S System

64 Bit Key Permutation Choice 1 56 Bit Key 28 Bit C0 28 Bit D0 Left Shift Right Shift C1 D1 Building Blocks Permuted Choice 2 K1(48 bits) C16 D16 Permuted Choice 2

Key Schedule

K16(48 bits)

27

slide-29
SLIDE 29

Li-1 32 bits Ri-1 32 bits

S-Box Substitution choses 32 bits

P-box Permutation Li 32 bits Ri 32 bits 56 bits Key Permuted Choice 48 bits

Func Functio tion n F

Expansion (E) Permutation 48 bits

28

slide-30
SLIDE 30

30

DE DES S Substit itutio ion B Boxes O Operatio ion

29

slide-31
SLIDE 31

31

Op Operation Tables s of f DES (I (IP, , IP-1, , E E and P)

30

slide-32
SLIDE 32

32 31

slide-33
SLIDE 33

33 32

slide-34
SLIDE 34

Br Breaki king DES S (Cr (Cryp yptanalysi sis) s)

DES Key size = 56 bits

  • Brute force = 255 attempts on avg
  • Differential cryptanalysis è 247 chosen plaintexts
  • Linear cryptanalysis è 247 known plaintexts
  • Longer than 56 bit keys do not make it any stronger
  • More than 16 rounds do not make it any stronger
  • DES Key Problems:
  • Weak keys (all 0s, all 1s, a few others)
  • Key size = 56 bits = 8 * 7-bit ASCII
  • Alphanumeric-only password converted to uppercase

8 * ~5-bit chars = 40 bits

33

slide-35
SLIDE 35

Br Breaki king DES S (Cr (Cryp yptanalysi sis) s)

Differential Cryptanalysis

  • Looks for correlations in F()-function input and output

Linear Cryptanalysis

  • Looks for correlations between key and cipher input and
  • utput

Related-key Cryptanalysis

  • Looks for correlations between key changes and cipher

input/output Differential cryptanalysis discovered in 1990; virtually all block ciphers from before that time are vulnerable... ... except DES. IBM (and the NSA) knew about it 15 years earlier

34

slide-36
SLIDE 36

Mo Modes of Operation (n (not just for DES, , for any y block k cipher)

ENCRYPTION

… … …

P1 P2 Pi Pi+1 Pn-1 Pn C1 C2 Ci Ci+1 Cn-1 Cn

http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation

35

slide-37
SLIDE 37

"Na Native” ” EC ECB Mode

Electronic Code-Book (ECB) Mode

  • Input to encryption algorithm is current plaintext block:

Ci = E ( K, Pi ) Pi = D ( K, Ci )

  • Duplicate plaintext blocks (patterns) visible in ciphertext
  • What if Alice encrypts one word per plaintext block?
  • Ciphertext block rearrangement is possible
  • To detect it, need explicit block numbering in plaintext
  • Parallel encryption and decryption (random access)
  • Error in one ciphertext block è one-block loss
  • One-block loss in ciphertext?

36

slide-38
SLIDE 38

CBC CBC Mo Mode

Cipher-Block Chaining (CBC) Mode

  • Input to encryption algorithm is the XOR of current plaintext block and

preceding ciphertext block:

Ci = E ( K, Pi XOR Ci-1 ) C0=IV Pi = D ( K, Ci ) XOR Ci-1

  • Duplicate plaintext blocks (patterns) NOT exposed
  • Block rearrangement is detectable
  • No parallel encryption
  • How about parallel decryption?
  • Error in one ciphertext block è two-block loss
  • One-block ciphertext loss?

37

slide-39
SLIDE 39

39

slide-40
SLIDE 40

OF OFB B Mode

Output Feedback (OFB) Mode

  • Key-stream is produced by repeated encryption of Vo:

Ci = E ( K, Vi-1 ) XOR Pi V0=IV Pi = E ( K, Vi-1 ) XOR Ci

  • Duplicate plaintext blocks (patterns) NOT exposed
  • Block rearrangement is detectable
  • Key-stream is independent of plaintext
  • How does that affect speed of encryption? Parallelism?
  • Bit error in one ciphertext block è one-bit error in plaintext
  • One-block ciphertext loss è big mess J
  • Can encrypt less than block size

39

slide-41
SLIDE 41

CF CFB B Mo Mode

Cipher Feedback (CFB) Mode

  • Key-stream is produced by re-encryption of preceding ciphertext -- Ci-1:

Ci = Pi XOR E (K, Ci-1) C0=IV Pi = E ( K, Ci-1 ) XOR Ci

  • Duplicate plaintext blocks (patterns) NOT exposed
  • Block rearrangement is detectable
  • Key-stream is dependent on plaintext
  • How does that affect speed of encryption? Parallelism?
  • Bit error in one ciphertext block è one-bit + one-block loss in plaintext
  • Adversary can still selectively flip/change bits
  • One-block ciphertext loss è 1-extra-block loss
  • Can encrypt less than block size

40

slide-42
SLIDE 42

CTR TR Mode

Counter (CTR) Mode

  • Key-stream is produced by encryption increasing counter:

Ci = E ( K, CTRi ) XOR Pi CTRi = CTRi-1 + 1 Pi = E ( K, CTRi ) XOR Ci

  • Duplicate plaintext blocks (patterns) NOT exposed, unless?
  • Block rearrangement is detectable
  • Key-stream is independent of plaintext
  • Parallel encryption and decryption (random access)
  • Bit error in one ciphertext block è one-bit error in plaintext
  • One-block ciphertext loss è big mess
  • Can encrypt less than block size

41

slide-43
SLIDE 43

MA MAC C Mo Mode

Message Authentication Code (MAC) Mode

  • Encryption is the same as in CBC mode, but, ciphertext is NOT sent!

Ci = E ( K, Pi XOR Ci-1 ) C0=IV What is sent or stored: P1, . . ., Pn, Cn = MAC Receiver recomputes Cn with K and compares

  • Any change in plaintext results in unpredictable changes in MAC

42

slide-44
SLIDE 44

Ho How w to str treng engthen then DES: th the e cas ase e of double le DES

  • 2DES: C = DES ( K1, DES ( K2, P ) )
  • Seems to be hard to break by “brute force”, approx. 2111 trials
  • Assume Eve is trying to break 2DES and has a single (P,C) pair

Meet-in-the-middle (or Rendesvouz) ATTACK:

I. For each possible K’i (where 0 < i < 256) 1. Compute C’i= DES ( K’i , P ) 2. Store: [ K’i, C’i ] in table T (sorted by C’i) II. For each possible K”i (where 0 < i < 256) 1. Compute C”i = DES-1 ( K”i , C ) 2. Lookup C”i in T ç not expensive! 3. If lookup succeeds, output: K1=K’i, K2=K”i TOTAL COST: O(256) operations + O(256) storage

43

slide-45
SLIDE 45

DE DES V Var arian iants

  • 3-DES (Triple DES)
  • C = E(K1, D(K2, E(K1,P) ) ) à 112 effective key bits
  • C = E(K3, D(K2, E(K1,P) ) ) à 168 effective key bits
  • DESx
  • C= K3 XOR E(K2, (K1 XOR P) ) à seems like 184 key bits
  • Effective key bits à approx. 118
  • 2-DES:
  • C = E(K2,E(K1, P)) à rendezvous (meet-in-the-middle attack)
  • Another simple variation:
  • C = K1 XOR E(K1’, P) à weak!

NOTE: The same variants can be constructed out of any cipher

44

slide-46
SLIDE 46

DE DES V Var arian iants

Why does 3-DES (or generally n-DES) work? Because, as a function, DES is not a group…

A “group” is an algebraic structure. One of its properties is that, taking any 2 elements of the group (a,b) and applying an operator F() yields another element c in the group. Suppose: C = DES(K1,DES(K2,P)) There is no K, such that: for each possible plaintext P, DES(K,P) = C

45

slide-47
SLIDE 47

DE DES S Summar ary

  • Permutation/substitution block cipher
  • 64-bit data blocks
  • 56-bit keys (8 parity bits)
  • 16 rounds (shifts, XORs)
  • Key schedule
  • S-box selection secret …
  • DES “aging”
  • 2-DES: rendezvous attack
  • 3-DES: 112-bit security
  • DESx : 118-bit security

46

slide-48
SLIDE 48

Skipjack

  • Classified algorithm originally designed for the NSA-

sponsored Clipper chip

  • declassified in 1998
  • 32 rounds, breakable with 31 rounds
  • 80 bit key, inadequate for long-term security

GOST

  • GOST 28147, Russian answer to DES
  • 32 rounds, 256 bit key
  • Incompletely specified

Ot Other Ol Old Sy Symmetric Ci Ciphers

47

slide-49
SLIDE 49
  • IDEA (X. ILai, J. Massey, ETH)
  • Developed as PES (proposed encryption standard),
  • adapted to resist differential cryptanalysis
  • Gained popularity via PGP, 128 bit key
  • Patented (Ascom CH)
  • Blowfish (B. Schneier, Counterpane)
  • Optimized for high-speed execution on 32-bit processors
  • 448 bit key, relatively slow key setup
  • Fast for bulk data on most PCs/laptops
  • Easy to implement, runs in ca. 5K of memory

Ot Other Sy Symmetric Ci Ciphers

48

slide-50
SLIDE 50
  • RC4 (Ron’s Cipher #4) Stream Cipher:
  • Optimized for fast software implementation
  • Character streaming (not bit)
  • 8-bit output
  • Former trade secret of RSADSI,
  • Reverse-engineered and posted to the net in 1994:
  • 2048-bit key
  • Used in many products until about 1999-2000

Ot Other Sy Symmetric Ci Ciphers

49

slide-51
SLIDE 51

x=y=0; while( length-- ) { /* state[0-255] contains key bytes */ sx = state[ ++x & 0xFF ]; y += sx & 0xFF; sy = state[ y ]; state[ y ] = sx; state[ x ] = sy; *data++ ^= state[ ( sx+sy ) & 0xFF ]; } Takes about a minute to implement from memory

Ot Other Sy Symmetric Ci Ciphers (R (RC4 C4)

50

slide-52
SLIDE 52

Ot Other Sy Symmetric Ci Ciphers

  • RC5 (Ron’s Cipher #5)
  • Suitable for hardware and software
  • Fast, simple
  • Adaptable to processors of different word lengths
  • Variable number of rounds
  • Variable-length key (0-256 bytes)
  • Very low memory requirements
  • High security (no effective attacks, yet…)
  • Data-dependent rotations

52

slide-53
SLIDE 53

Ot Other Sy Symmetric Ci Ciphers

  • RC5 single round pseudocode:

52

slide-54
SLIDE 54

Adv Advanc nced d Enc Encryp yption n Standa ndard d (AE (AES): ): Th The Ri Rijndael Bl Block k Ci Cipher

55

slide-55
SLIDE 55
  • National Institute of Science and Technology (NIST) regulates

standardization in the US

  • By mid-90s, DES was an aging standard that no longer met the needs for

strong commercial-grade encryption

  • Triple-DES: Endorsed by NIST as a “de facto” standard
  • But … slow in software and large footprint (code size)
  • Advanced Encryption Standard (AES)
  • Finalized in 2001
  • Goal is to define the Federal Information Processing Standard (FIPS) by

selecting a new encryption algorithm suitable for encrypting (non-classified non-military) government documents

  • Candidate algorithms must be:
  • Symmetric-key ciphers supporting 128, 192, and 256 bit keys
  • Royalty-Free
  • Unclassified (i.e., public domain)
  • Available for worldwide export

In Intr troduc ductio tion n and and His History

56

slide-56
SLIDE 56

In Intr troduc ductio tion n and and His History

  • AES Round-3 Finalist Algorithms:
  • MARS
  • Candidate offering from IBM Research
  • RC6
  • By Ron Rivest of MIT & RSA Labs, creator of the widely used

RC4/RC5 algorithm and “R” in RSA

  • Twofish
  • From Counterpane Internet Security, Inc. (MN)
  • Serpent
  • by Ross Anderson (UK), Eli Biham (ISR) and Lars Knudsen (NO)
  • Rijndael
  • by Joan Daemen and Vincent Rijmen (B)

57

slide-57
SLIDE 57

The Winner: Rijndael

  • Joan Daemen (of Proton World International) and Vincent Rijmen (of

Katholieke Universiteit Leuven).

  • Pronounced “Rhine-doll”
  • Allows only 128, 192, and 256-bit key sizes (unlike other candidates)
  • Variable input block length: 128, 192, or 256 bits. All nine

combinations of key-block length possible.

  • A block is the smallest data size the algorithm will encrypt
  • Vast speed improvement over DES in both hw and sw

implementations

  • 8,416 bytes/sec on a 20MHz 8051
  • 8.8 Mbytes/sec on a 200MHz Pentium Pro

Ri Rijndael

58

slide-58
SLIDE 58

P

r1

Key

r2 Rn-1 rn r3

C

Rn-2 k1 k2 Kn-1 kn k3 Kn-2

K KE Key Expansion Round Keys Encryption Rounds r1 … rn

  • Key is expanded to a set of n round keys
  • Input block P put thru n rounds, each with a distinct round sub-key.
  • Strength of algorithm relies on difficulty of obtaining intermediate results (or

state) of round i from round i+1 without the round key.

Ri Rijndael

59

slide-59
SLIDE 59

Ri Rijndael

Detailed view of round n

  • Each round performs the following operations:
  • Non-linear Layer: No linear relationship between the input and output of a round
  • Linear Mixing Layer: Guarantees high diffusion over multiple rounds
  • Very small correlation between bytes of the round input and the bytes of the
  • utput
  • Key Addition Layer: Bytes of the input are simply XOR’ed with the expanded round

key

ByteSub ShiftRow MixColumn AddRoundKey

Kn

Result from round n-1 Pass to round n+1 60

slide-60
SLIDE 60

Ri Rijndael

  • Three layers provide strength against known types of

cryptographic attacks: Rijndael provides “full diffusion” after

  • nly two rounds
  • Immune to:
  • Linear and differential cryptanalysis
  • Related-key attacks
  • Square attack
  • Interpolation attacks
  • Weak keys
  • Rijndael has been “shown” secure:
  • No key recovery attacks faster than exhaustive search exist
  • No known symmetry properties in the round mapping
  • No weak keys identified
  • No related-key attacks: No two keys have a high number of expanded

round keys in common

61

slide-61
SLIDE 61

Ri Rijndael: : By ByteSub

Each byte at the input of a round undergoes a non-linear byte substitution according to the following transform: Substitution (“S”)-box

62

slide-62
SLIDE 62

Ri Rijndael: : Sh ShiftRow

Depending on the block length, each “row” of the block is cyclically shifted according to the above table

63

slide-63
SLIDE 63

Ri Rijndael: : Mi MixCo Column mn

Each column is multiplied by a fixed polynomial C(x) = ’03’*X3 + ’01’*X2 + ’01’*X + ’02’ This corresponds to matrix multiplication b(x) = c(x) Ä a(x):

Not XOR

64

slide-64
SLIDE 64

Ri Rijndael: : Key Expansion and Addition

Each word is simply XOR’ed with the expanded round key

KeyExpansion(int* Key[4*Nk], int* EKey[Nb*(Nr+1)]) { for(i = 0; i < Nk; i++) EKey[i] = (Key[4*i],Key[4*i+1],Key[4*i+2],Key[4*i+3]); for(i = Nk; i < Nb * (Nr + 1); i++) { temp = EKey[i - 1]; if (i % Nk == 0) temp = SubByte(RotByte(temp)) ^ Rcon[i / Nk]; EKey[i] = EKey[i - Nk] ^ temp; } }

Key Expansion algorithm:

65

slide-65
SLIDE 65

Ri Rijndael: : Imp mpleme mentations

  • Well-suited for software implementations on 8-bit processors

(important for “Smart Cards”)

  • Atomic operations focus on bytes and nibbles, not 32- or 64-bit integers
  • Layers such as ByteSub can be efficiently implemented using small tables

in ROM (e.g., < 256 bytes).

  • No special instructions are required to speed up operation, e.g., barrel

rotates

  • For 32-bit implementations:
  • An entire round can be implemented via a fast table lookup routine on

machines with 32-bit or higher word lengths

  • Considerable parallelism exists in the algorithm
  • Each layer of Rijndael operates in a parallel manner on the bytes of the round

state, all four component transforms act on individual parts of the block

  • Although the Key expansion is complicated and cannot benefit much from

parallelism, it only needs to be performed once until the two parties switch keys.

66

slide-66
SLIDE 66

Ri Rijndael: : Imp mpleme mentations

  • Hardware Implementations
  • Rijndael performs very well in software, but there are cases when better

performance is required (e.g., server and VPN applications).

  • Multiple S-Box engines, round-key XORs, and byte shifts can all be

implemented efficiently in hardware when absolute speed is required

  • Small amount of hardware can vastly speed up 8-bit implementations
  • Inverse Cipher
  • Except for the non-linear ByteSub step, each part of Rijndael has a

straightforward inverse and the operations simply need to be undone in the reverse order.

  • However, Rijndael was specially written so that the same code that

encrypts a block can also decrypt the same block simply by changing certain tables and polynomials for each layer. The rest of the operation remains identical.

67

slide-67
SLIDE 67

Conclusions and Th The Future

  • Rijndael is an extremely fast, state-of-the-art, highly

secure algorithm

  • Amenable to efficient implementation in both hw

and sw; requires no special instructions to obtain good performance on any computing platform

  • Triple-DES, still highly secure and supported by NIST,

is expected to be common for the foreseeable future.

68

slide-68
SLIDE 68

Re Reminder: : Wo World’s Bes est t Cip ipher er!

69

slide-69
SLIDE 69

On One-Ti Time Pad (OTP TP)

For each character:

0 1 1 1 0 0 1 0 1 1 0

pad

(key)

1 0 1 1 0 1 0 1 1 0 0

ciphertext

(encrypted msg)

Å

1 1 0 0 0 1 1 1 0 1 0

msg

(plaintext)

70

slide-70
SLIDE 70

On One-Ti Time Pad (cont.)

  • Symmetric
  • Pad is selected at random
  • Pad is as long as plaintext
  • Perfectly secure, but ...
  • One time only:

so sending the pad is just as hard as sending the msg

71