unit-1-intro1-chap1
unit-1-intro1-chap1
Introduction
What is
cryptography?
Information Transferring
no eavesdropping
no tampering
Secure Sockets Layer
Two main parts
attacker???
Secure communication:
k m1
k
m2
confidentiality and integrity
But crypto can do much more
• Digital signatures
• Anonymous communication
Alice
Who did I signature
just talk to?
Alice
Bob
Building block: sym. encryption
Alice Bob
m E(k,m)=c c D(k,c)=m
E D
k k
30.12
Figure 1.1 Cryptography
components
30.13
Figure 2 Categories of
cryptography
30.14
Figure 3 Symmetric-key
cryptography
30.15
Not
e
In symmetric-key cryptography, the
same key is used by the sender
(for encryption)
and the receiver (for decryption).
The key is shared.
30.16
Figure 4 Asymmetric-key
cryptography
30.17
Figure 5 Keys used in
cryptography
30.18
Figure 6 Comparison between two categories of
cryptography
30.19
Attacks, Services and Mechanisms
Security Attacks
Action compromises the information security
Security Services
Enhances the security of data processing
and transferring
Security mechanism
Detect, prevent and recover from a security
attack
principal principal
Security Security
transformation transformation
opponent
Cryptography and Network Security
Cryptography
Cryptography is the study of
Secret (crypto-) writing (-graphy)
Concerned with developing algorithms:
Conceal the context of some message from all except
the sender and recipient (privacy or secrecy), and/or
Verify the correctness of a message to the recipient
(authentication)
Form the basis of many technological solutions to
computer and communications security problems
Decipher P = D(K2)(C)
Plaintext ciphertext
Encipher C = E(K1)(P)
Plaintext
ciphertext
Key source
Drawbacks
Large overhead
Virtually useless if system is known
Double Letter
TH,HE,IN,ER,RE,ON,AN,EN,….
Triple Letter
THE,AND,TIO,ATI,FOR,THA,TER,RES,…
s i/j m p l
e a b c d
f g h k n
o q r t u
v w x y z
Key: simple
Decryption
P=K-1C mod 26
Decryption
P=CK
SYMMETRIC-KEY CRYPTOGRAPHY
30.58
Figure 30.7 Traditional
ciphers
30.59
Note
Solution
The cipher is probably monoalphabetic because both
occurrences of L’s are encrypted as O’s.
30.62
Example 30.2
The following shows a plaintext and its corresponding
ciphertext. Is the cipher monoalphabetic?
Solution
The cipher is not monoalphabetic because each
occurrence of L is encrypted by a different character.
The first L is encrypted as N; the second as Z.
30.63
The shift cipher is sometimes referred to
as the Caesar cipher.
30.64
Example 30.3
Use the shift cipher with key = 15 to encrypt the message
“HELLO.”
Solution
We encrypt one character at a time. Each character is
shifted 15 characters down. Letter H is encrypted to W.
Letter E is encrypted to T. The first L is encrypted to A.
The second L is also encrypted to A. And O is encrypted
to D. The cipher text is WTAAD.
30.65
Example 30.4
Use the shift cipher with key = 15 to decrypt the message “WTAAD.”
•Solution
•We decrypt one character at a time. Each character is shifted
15 characters up. Letter W is decrypted to H. Letter T is
decrypted to E. The first A is decrypted to L. The second A is
decrypted to L. And, finally, D is decrypted to O. The
plaintext is HELLO.
30.66
A transposition cipher reorders
(permutes) symbols in a block of
symbols.
30.67
Figure 30.8 Transposition
cipher
30.68
Example 30.5
Encrypt the message “HELLO MY DEAR,” using the key shown in Figure 30.8.
•Solution
•We first remove the spaces in the message. We then divide the
into blocks of four characters. We add a bogus character Z at
end of the third block. The result is HELL OMYD EARZ. We crea
threeblock ciphertext ELHLMDOYAZER.
30.69
Example 30.6
Using Example 30.5, decrypt the message
“ELHLMDOYAZER”.
•Solution
•The result is HELL OMYD EARZ. After removing the bogus character a
combining the characters, we get the original message “HELLO MY
DEAR.”
30.70
Simple Modern
Ciphers
30.71
Figure 30.9 XOR
cipher
30.72
Figure 30.10 Rotation
cipher
30.73
Figure 30.11 S-
box
30.74
Figure 30.12 P-boxes: straight, expansion, and
compression
30.75
Modern Round
Ciphers
30.76
Figure 30.13
DES
30.77
Figure 30.14 One round in DES
ciphers
30.78
Figure 30.15 DES
function
30.79
Figure 30.16 Triple
DES
30.80
Table 30.1 AES
configuration
30.81
Note
30.83
Figure 30.18 Structure of each
round
30.84
Figure 30.19 Modes of operation for block
ciphers
30.85
Figure 30.20 Electronic Code Book mode
(ECB)
30.86
Figure 30.20 Electronic Code Book mode
(ECB)
30.87
Figure 30.21 Cipher Block Chaining mode
(CBC)
30.88
Figure 30.21 Cipher Block Chaining mode
(CBC)
30.89
Figure 30.22 Cipher FeedBack mode
(CFB)
30.90
Figure 30.22 Cipher FeedBack mode
(CFB)
30.91
Figure 30.23 Output FeedBack mode
(OFB)
30.92
Figure 30.23 Output FeedBack mode
(OFB)
30.93
30-3ASYMMETRIC-KEY
CRYPTOGRAPHY
An asymmetric-key (or public-key) cipher uses two
keys: one private and one public. We discuss two
algorithms: RSA and Diffie-Hellman.
30.94
Figure 30.24 Rivest Shamir Adleman
(RSA)
30.95
In RSA, e and n are announced to the
public; d and are kept secret.
30.96
30.97
30.98
Example 30.7
Bob chooses 7 and 11 as p and q and calculates
n = 7 x 11 = 77. The value of = (7 − 1) (11 − 1) or 60.
Now he chooses two keys, e and d. If he chooses e to be
13, then d is 37. Now imagine Alice sends the plaintext 5
to Bob. She uses the public key 13 to encrypt 5.
30.99
Example 30.7 (continued)
Bob receives the ciphertext 26 and uses the private key 37
to decipher the ciphertext:
30.
30.
Not
e
The symmetric (shared) key in the
Diffie-Hellman protocol is
K = gxy mod p.
30.
Procedure
30.
3. Rotor Machines (1870-1943)
Early example: the Hebern machine (single rotor)
A K E N
B S K E
C T S K
. . T S
. . . T
X R . .
Y N R .
Z key E N R
Rotor Machines (cont.)
Most famous: the Enigma (3-5 rotors)
0 1 1 0 1 1 1
⊕
1 0 1 1 0 1 0
An important property of XOR
Thm: Y a rand. var. over {0,1}n , X an indep. uniform var. on {0,1}n
Then Z := Y⨁X is uniform var. on {0,1}n