ISS L2 SymmetricCrypto
ISS L2 SymmetricCrypto
ISS L2 SymmetricCrypto
Symmetric Cryptography
(Lecture 2)
Outline
1. Cryptography
2. Symmetric Cipher systems
3. Stream Cipher
3.1 Vernam Cipher
3.2 One-time pad
3.3 Properties of stream ciphers
4. Block cipher
4.1 DES
4.2 Triple DES
4.3 AES
4.4 other Block ciphers
5. Modes of operation
2
1. Cryptography (1/4)
Receiver
Sender secret key Snooper secret key
Encryption
Decryption
Algorithm
plaintext ciphertext algorithm plaintext
(eg, AES)
5
Cryptography (4/4)
– Keyless Cryptography
Lecture 4
Hash (message digest) functions
6
2. Symmetric-key systems (1/2)
Encryption Decryption
Algorithm algorithm
plaintext ciphertext plaintext
E … E … E … E … E E E E E
10
3.1 Vernam Cipher
Vernam Cipher A stream cipher defined on the
alphabet A={0,1}
The keystream is a binary string (k=k1…kt) of the
same length as the plaintext m (=m1 … mt)
Encryption ci=mi ki , Decryption mi=ci ki
random key bits k1, k2,…, kn
p1 k1 p2 k2…pn Kn
+
ciphertext bits
12
One-time pad
13
3.3 Properties of stream ciphers
Advantages:
No error propagation: a ciphertext digit is modified during
transmission doesn’t affect the decryption of other ciphertext
digits
Easy for implementation and Fast
Drawbacks:
Requirement for synchronization: sender and receiver must
be synchronized
ie, they must use the same key and operate on the same
position (digit),
if synchronization is lost due to digit insertion or deletion
then re-synchronization is required.
14
3.3 Properties of stream ciphers
15
4. Block ciphers
16
4.1 Data Encryption Standard
(DES)
Adopted in 1977 by the National Bureau of
Standards (US), nowadays NIST
– FIPS 46
Encryption key
56
17
Data Encryption Standard (DES)
2004: Withdrawn
18
4.2 Triple DES (3DES)
plaintext
1
Encrypt
Key K1
• Key =k1k2k3 Using DES
Using DES
3
Encrypt
Key K3
Using DES
19
ciphertext
4.3 Advanced Encryption Standard
(AES)
In November 2001 the USA NIST announced
Rijndael algorithm as the AES to replace DES as a
FIPS 197
Became effective in May 2002
Encryption key
128, 192, or 256
20
AES
For encryption, each round consists of four
stages:
– Substitute Bytes — a non-linear substitution step where
each byte is replaced with another according to a
lookup table, an S-block.
– ShiftRows — a transposition step where each row of the
state is shifted cyclically a certain number of steps.
– MixColumns — a mixing operation which operates on
the columns of the state, combining the four bytes in
each column using a linear transformation.
– AddRoundKey — each byte of the state is combined
with the round key; each round key is derived from the
cipher key using a key schedule.
Except for the last round in each case, all other
rounds are identical.
21
AES-Encryption
xj
key key
E E-1
n
cj xj
Encryption Decryption
25
ECB
Identical plaintext blocks (under the same key)
result in identical ciphertext.
Chaining dependency: blocks are enciphered
independently of other blocks.
Error propagation: one or more bit errors in a
single ciphertext affect decipherment of that
block only.
ECB is not recommended for messages longer
than one block, or if keys are reused for more
than one-block message.
Security of ECB may be improved by inclusion of
random padding bits in each block. 26
Electronic CodeBook (ECB)
27
5.2 Cipher-Block Chaining (CBC)
c0=IV
cj-1
xj n
+
key key
-1
E E
n
+ cj-1
cj
xj
Encryption decryption
28
CBC
IV Shift register
S bits
K E K E
S-CFB
S S
P0 P1
30
Sender C0 Sender C1
CFB Decryption
31
Properties of block ciphers
32
Properties of block ciphers
33
34
References
Library: System.Security.Cryptography
41