5.1 Modern Block Cipher
●modern block cipher分為兩種:transposition cipher 和 substitution cipher
○transposition cipher:key長度為⌈log2 n!⌉ bit
(n!種對應)
○substitution cipher:key長度為⌈log2 (2n)!⌉ bit
(2n!種對應)
●P-boxes:transposes bits
○Straight P-box:input bit = output bit
○Compression P-box:input bit > output bit
○Expansion P-box:input bit < output bit
只有Straight P-box為可逆
e.g.
input: a b c d e f g h
P-box: [4 1 2 3 6 7 8 5]
output: d a b c f g h e
○invert P-boxes:
1. 加index
2. 將內容和index交換
3.以index做sort
e.g.
1. original: [6 3 4 5 2 1]
2. Add index:[6 3 4 5 2 1]
1 2 3 4 5 6
3. Swap index和content:[1 2 3 4 5 6]
6 3 4 5 2 1
4. 根據index做sort:[6 5 2 3 4 1]
1 2 3 4 5 6
●S-boxes: m x n substitution unit
e.g.
y1 = x1 + x2 + x3
y2 = x1
●operation:
○XOR
○circular shift
○swap:circular shift n/2
○split and combine
●diffusion:將plaintext 和 ciphertext 的關係藏起
●confusion:將ciphertext和key的關係藏起
modern block cipher 都是product cipher
可分為兩種:
○Feistel cipher
○non-Feistel cipher
5.2modern stream cipher:
●synchronous stream cipher:key和plaintext或ciphertext無關
○Feedback shift register(FSR):產生key
e.g.
b4 = b1+ b0
→LFSR產生的key為pseudo random(有cycle,最大cycle為2m-1,m為cell數量)
→可以用polynomial 去表示
e.g. b4 = b1 + b0
可用 x4 + x +1 表示
●non-synchronous stream cipher:每一個key stream 裡的key均depend on先前的plaintext或ciphertext
沒有留言:
張貼留言