Professional Documents
Culture Documents
Symmetric Cryptography: Block Ciphers and Stream Ciphers
Symmetric Cryptography: Block Ciphers and Stream Ciphers
Symmetric Cryptography: Block Ciphers and Stream Ciphers
Stream Ciphers
K
Stream
Cipher
c =p z and p =c z
c cipher text
p plain text
z key stream
Stream Ciphers
K z k
c
p
zk
=
c i=
pi
zk
c
p j
zk
j=
Attacker has access to c
i and c
j
c
pi
z k )(
p j
z k )=
pi p
i c
j=(
j
XORing two cipher-texts encrypted using the same seed results in XOR of
corresponding plain-texts
Redundancy in plain-text structure can be easily used to determine both plaintexts
And hence, the key stream
Never reuse seed?
Impractical
Extend seed using an initial value (IV) which can be sent in the clear
Never reuse IV
Block Ciphers
C=E(P,K)
P=D(C,K)
Desired Properties
input any plain text to encryption block to get cipher text, and
can input any cipher text to get corresponding plain text
m output bits
Feistel Structure
Ri 1
Li1
+
Li
Ki
Ri
Encryption
Li =R i1
Ri =Li1 F ( Ri1 , K i )
Li
Ri
+
Ri1
Ki
Li 1
Decryption
Ri 1=Li
Li 1= Ri F (Li , K i )
R0
K1
L1
R1
K2
L2
R2
L15
R15
K 16
L16
R16
Issues
ECB
ECB Mode
Mode
C i =E( P i )
P1
P2
C1
C2
...
P i= D(C i )
Pn
C1
C2
Cn
P1
P2
Cn
...
Pn
P i= E( Ci )C i1 where C 0=IV
IV
C0
P1
P2
P3
Pn
C1
C2
C1
C2
...
IV
C n1 C n
P1
P2
C n1
Cn
D
...
+
Pn
CBC
CBC Mode
Mode
C i =E(C i1 )P i , C 0= IV
IV
P1
E
+
C1
E
P2
C2
...
Pn
C n1
P i= E(Ci 1 )C i , C 0= IV
+
Cn
IV
P1
E
+
C1
E
P2
+
C2
...
Pn
C n1
+
Cn
CFB
CFB Mode
Mode
O1
P i=C iOi
O2
IV
E
...
P1
P2
C1
+
C2
P3
+
C3
OFB
OFB Mode
Mode
O1
O2
E
...
P1
P2
C1
+
C2
P3
+
C3
Not parallelizable
CTR
CTR Mode
Mode
C i =P i E( X +i)
X + 1 X+ 2 X+ 3
P1
C1
P2
C2
P3
C3
P i=C i E( X +i)
X + 1 X+ 2 X + 3
E
...
P1
E
P2
C1
+
C2
E
P3
+
C3
...
Summary
Summary