Experiment 2
This presentation is the property of its rightful owner.
Sponsored Links
1 / 18

Experiment 2 Problem 1 Grain-128 stream cipher PowerPoint PPT Presentation


  • 29 Views
  • Uploaded on
  • Presentation posted in: General

Experiment 2 Problem 1 Grain-128 stream cipher. Cipher. Message / Ciphertext. m bits. Cryptographic Key. Encrypt/Decrypt. k bits. 1 bit. m bits. Ciphertext / Message. Secret-Key Ciphers. key of Alice and Bob - K AB. key of Alice and Bob - K AB. Network. Decryption.

Download Presentation

Experiment 2 Problem 1 Grain-128 stream cipher

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Experiment 2 problem 1 grain 128 stream cipher

Experiment 2

Problem 1

Grain-128 stream cipher


Experiment 2 problem 1 grain 128 stream cipher

Cipher

Message / Ciphertext

m bits

Cryptographic

Key

Encrypt/Decrypt

k bits

1 bit

m bits

Ciphertext / Message


Experiment 2 problem 1 grain 128 stream cipher

Secret-Key Ciphers

key of Alice and Bob - KAB

key of Alice and Bob - KAB

Network

Decryption

Encryption

Bob

Alice


Block vs stream ciphers

Block vs. stream ciphers

M1, M2, …, Mn

m1, m2, …, mn

memory

Block

cipher

K

K

Stream

cipher

C1, C2, …, Cn

c1, c2, …, cn

Ci=fK(Mi)

ci = fK(mi, mi-1, …, m2, m1)

Every block of ciphertext

is a function of only one

corresponding blockof plaintext

Every block of ciphertext

is a function of the current and

all proceeding blocks of plaintext


Typical stream cipher

Typical stream cipher

Sender

Receiver

Initialization

Vector - IV

Initialization

Vector - IV

Key - K

Key - K

Pseudorandom

Key

Generator

Pseudorandom

Key

Generator

keystream

ki

keystream

ki

mi

ci

ci

mi

plaintext

ciphertext

ciphertext

plaintext


Experiment 2 problem 1 grain 128 stream cipher

Example

ci = mi ki

message

mi

ki

ci

01110110101001010110101

11011101110110101110110

10101011011111111000011

keystream

ciphertext

mi = ci ki

ci

ki

mi

ciphertext

10101011011111111000011

11011101110110101110110

01110110101001010110101

keystream

message


Experiment 2 problem 1 grain 128 stream cipher

Grain-128: Keystream Generator

zi

keystream


Experiment 2 problem 1 grain 128 stream cipher

Example of a simpler 5-stage LFSR

LFSR = Linear Feedback Shift Register

si

si+1

si+2

si+3

si+4

si+5

si+5 = si + si+1 + si+3

+ is used to denote XOR


Experiment 2 problem 1 grain 128 stream cipher

LFSR in Grain-128

si+7

si+96

si+38

si+70

si+81

. . . .

si

si+1

si+2

si+126

si+127

si+128

+ is used to denote XOR


Experiment 2 problem 1 grain 128 stream cipher

Example of a simpler 5-stage NFSR

NFSR = Non-Linear Feedback Shift Register

bi

bi+1

bi+2

bi+3

bi+4

bi+5

bi+5 = bibi+1 + bi+3

+ is used to denote XOR

bmbn is used to denote bm AND bn


Experiment 2 problem 1 grain 128 stream cipher

NFSR in Grain-128

bi+26

bi+68 bi+84

. . . .

bi+56

bi+91

si

. . . .

bi

bi+1

bi+2

bi+126

bi+127

bi+128

+ is used to denote XOR

bmbn is used to denote bm AND bn


Experiment 2 problem 1 grain 128 stream cipher

Output function in Grain-128


Experiment 2 problem 1 grain 128 stream cipher

Grain-128: Keystream Generator

zi

keystream


Key and iv initialization

Key and IV Initialization

Phase 1

Initial state of NFSR:

bi = ki for i=0..127, where ki are bits of the key, k

Initial state of LFSR:

si = IVi for i=0..95, where IVi are bits of the

si = ‘1’ for i=96..127 initialization vector, IV

Phase 2

256 clock cycles of key mixing using connections

shown in the next slide

(output fed back and xor’ed with inputs to LFSR and NFSR)


Experiment 2 problem 1 grain 128 stream cipher

Grain-128: Connections in the circuit

during Key & IV Initialization, Phase 2


Experiment 2 problem 1 grain 128 stream cipher

Grain-128: Keystream Generation

Optimization for 2 bits per clock cycle


Experiment 2 problem 1 grain 128 stream cipher

Example

Programmable LFSR-based

Pseudorandom

Number Generator


Experiment 2 problem 1 grain 128 stream cipher

cL-1

cL-2

c1

c0

sin

Current_state


  • Login