+ All Categories
Home > Documents > Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,...,...

Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,...,...

Date post: 01-Jan-2016
Category:
Upload: allen-hudson
View: 220 times
Download: 2 times
Share this document with a friend
Popular Tags:
44
Stream Cipher
Transcript
Page 1: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Stream Cipher

Page 2: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Stream CipherA stream cipher breaks the message M into successive characters or bits m1, m2, ..., and enciphers each mi with the ith element ki of a key stream K=k1k2...; that is,

EK(M)=Ek1(m1)Ek2(m2)...

Page 3: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

PeriodicA stream cipher is periodic if the key stream repeats after d characters for some fixed d; otherwise, it is nonperiodic.Periodic:

Rotor cipher, Hagelin cipher

Nonperiodic:Vernam cipher (one-time pad), running-key cipher

Page 4: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Stream CipherTwo different approaches:

synchronous methodsself-synchronous methods

Page 5: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Synchronous Stream CipherThe key stream is generated independently of the message stream.If a ciphertext character is lost during transmission, the sender and receiver must resynchronize their key generators before they can proceed further.

Page 6: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Synchronous Stream CipherMust ensure no part of the key stream is repeatedLinear Feedback Shift RegistersOutput-block Feedback ModeCounter Method

Page 7: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Example of SSC

Page 8: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Self-synchronous MethodsEach key character is derived from a fixed number n of preceding ciphertext characters.If a ciphertext character is lost or altered during transmission, the error propagates forward for n characters, but the cipher resynchronizes by itself after n correct ciphertext character have been received.Autokey cipher and Cipher Feedback Mode (CFM)Nonperiodic.

Page 9: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Example of Self-synchronous

Page 10: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Error HandlingIf errors are propagated by the decryption algorithm, applying error detecting codes before encryption provides a mechanism for authenticity.

Page 11: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Synchronous Stream Cipherkey stream is generated independently of the message streamkey stream must deterministic so the stream can be reproduced for decipherment.How to generate a random key stream?The starting stage of the key generator is initialized by a “seed” I0.

Page 12: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Stream CipherStream ciphers are often breakable if the key stream repeats or has redundancy.To be un breakable, it must be a random sequence as long as the plaintext.Each element in the key alphabet should be uniformly distributed over the key stream, and there should be no long repeated subsequences or other patterns.No finite algorithm can generate truly random sequences.

Page 13: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

LFSRLFSR (Linear Feedback Shift Register)

shift register R=(rn, rn-1, ..., r1)

“tap” sequence T=(tn, tn-1, ..., t1)

ti and ri are binary digit

bit r1 is appended to the key stream,

bits rn, ...,r2 are shifted right

a new bit derived from T and R is inserted into the left end of the register.

Page 14: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

LFSRLetting R’=(rn’, rn-1’, ... r1’) denote the next state of R, we see that the computation of R’ is thus:ri’=ri+1 i=1,...,n-1rn’=TR=∑n

i=1tiri mod 2R’=HR mod 2, where H is the nxn matrix.T(x)=tnxn + tn-1xn-1 + ... + t1x + 1若 T(x)為質多項式( primitive polynomial)則可以產生 2n-1個 sequence.

Page 15: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

LFSR

Page 16: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

LFSR

Page 17: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Example of LFSR

Page 18: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Example of LFSR

Page 19: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Example of LFSR

Page 20: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Example of LFSR

Page 21: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

LFSRThe feedback loop attempts to simulate a one-time pad by transforming a short key I0 into a long pseudo-random sequence K.Unfortunately, the result is a poor approximation of the one-time pad.

Page 22: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Example of LFSR

Page 23: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Cryptanalysis of LFSRKnown-plaintext attack2n pairs of plaintext-ciphertext pairsM=m1...m2n, C=c1...c2n

mici=mi (mi ki)=ki, i=1,...,2n

Page 24: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Cryptanalysis of LFSR

Page 25: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Output-Block Feedback Modeweakness of LFSR is caused by the linearity of R’=HR mod 2Nonlinear block ciphers such as the DES seem to be good candidates for this.

Page 26: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Output-block Feedback Mode

Page 27: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Counter MethodSuccessive input blocks are generated by a simple counter.It is possible to generate the ith key character k i without generating the first i-1 key characters by setting the counter to I0 + i –1

Page 28: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Counter Method

Page 29: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Self-Synchronous Stream Cipher

A Self-synchronous stream cipher derives each key character from a fixed number n of preceding ciphertext characters.Autokey Cipher and Cipher Feedback

Page 30: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Autokey CipherAn autokey cipher is one in which the key is derived from the message it enciphers. In Vigenere first cipher, the key is formed by appending the plaintext M= m1m2... to a “priming key” character k1; the ith key character (i>1) is thus given by ki=mi-1.

Page 31: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Autokey CipherIn Vigenere second cipher, the key is formed by appending each character of the ciphertext to the priming key k1; that is, ki=ci-1 (i > 1)

Page 32: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.
Page 33: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Aotukey Cipher缺點: it exposes the key in the ciphertext streamThis problem is easily remedied by passing the ciphertext characters through a nonlinear block cipher to derive the key characters.Cipher Feedback mode (CFM)

Page 34: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Cipher Feedback mode (CFM)The ciphertext characters participate in the feedback loop.It is sometimes called “changing”, because each ciphertext character is functionally dependent on (chained to) preceding ciphertext characters.

Page 35: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Example of CFM

Page 36: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

亂數產生器LFSR線性同餘產生器非線性亂數產生器截切亂數產生器數學計算產生器分解因數法離散對數法二次剩餘法質數法

Page 37: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

LFSR

Page 38: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

線性同餘產生器xi=axi-1 + b (mod m)x0為初值a, b, m 為 KEY條件:

gcd(b,m)=1對於每個能夠整除 M之質數 p而言, b=a-1必須為 p 之整數倍IF 4|m then 4|b

缺點:產生之亂數可預測

Page 39: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

非線性亂數產生器

Page 40: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

截切亂數產生器

Page 41: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

亂數產生器的安全性評估好的亂數產生器具備之特性週期長不可預測性( Unpredictable)測試法:

Chi-Square 測試法Kolmogorov-Smirnov(KS)測試法

Page 42: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

Chi-Square 測試法

Page 43: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.
Page 44: Stream Cipher. A stream cipher breaks the message M into successive characters or bits m 1, m 2,..., and enciphers each m i with the ith element k i of.

判斷標準


Recommended