Lec 6
Lec 6
Lec 6
Lec 6
Example:
1 0 0 1 1
1 1 0 0 1
------------------------------
0 1 0 1 0
Stream cipher
• Ci=Pi Ki
• i is the position of the bit within the stream
SEQUENCE
GENERATOR
Stream ciphers
Ci = Pi Ki Pi = Ci
Ki
0 0 11
Cipher Text (C)
0 1 01 011 0
Keystream (K)
P 0 0 1 1
K 0 1 0 1
C 0 1 1 0
Decryption process
Cipher Text (C)
0 0 1 1
01 01
Key (K)
C 0 1 1 0
K 0 1 0 1
P 0 0 1 1
Generating key sequence
The input strings differ in one bit while the output (ciphertext)
Confusion and Diffusion
• Note that modern block ciphers have block lengths
of 64 or 128.
Banking sector
• Payment applications, such as card
transactions
• Validations to confirm that the sender of a
message is who he claims to be.
Data at rest (to safeguard inactive data
wherever it resides by encrypting individual
sensitive files before storage or encrypting the
entire storage medium)
Asymmetric Encryption
Basics
• Uses a pair of keys for encryption
– Public key for encryption
– Private key for decryption
• Messages encoded using public key can only be decoded by
the private key
– Secret transmission of key for decryption is not required
– Every entity can generate a key pair and release its public key
• Authentication
• Digital Certificates
• Digital signatures (Digital signatures serve to
identify any unauthorized alterations to data
and verify the identity of the individual signing)
Asymmetric Encryption
Session-Key Encryption
Send to Recipient
Encrypted
Cipher Key
(RSA)
Session Key
Bob’s Cipher
Public Key
(DES) Alice and Bob
Bob’s Session Key
Generate Same
Private Key Session Key!
Alice’s Cipher
Public Key
(DES)
Digital Signatures
128 2128 = 3.4 1038 2127 µs = 5.4 1024 years 5.4 1018 years
168 2168 = 3.7 1050 2167 µs = 5.9 1036 years 5.9 1030 years
26 characters 26! = 4 1026 2 1026 µs = 6.4 1012 years 6.4 106 years
(permutation)
48
Cryptanalytic Attacks
• May be classified by how much information
needed by the attacker:
– Ciphertext-only attack
– Known-plaintext attack
– Chosen-plaintext attack
– Chosen-ciphertext attack
49
Ciphertext-only attack
• Given: a ciphertext c & the algorithm
• Q: what is the plaintext m?
• An encryption scheme is completely insecure
if it cannot resist ciphertext-only attacks.
50
Known-plaintext attack
• Given: (m1,c1), (m2,c2), …, (mk,ck) and a new
ciphertext c.
51
Applications of symmetric and asymmetric
Messaging applications,
like Signal or Whatsapp, use end-to-end
encryption to protect the confidentiality and
privacy of the users’ communications and to
authenticate the users.
Chosen-plaintext attack
53
Chosen-ciphertext attack
• Given: (m1,c1), (m2,c2), …, (mk,ck), where c1, c2,
…, ck are chosen by the adversary; and a new
ciphertext c.
54
Confidentiality
• Alice and Bob communicating through insecure channel
• Eve can listen and understand what is being said
How Encryption helps Confidentiality
• The insecure channel is secured by encrypting the communication
• Eve can listen but cannot understand what is being said
How Encryption helps Confidentiality
Integrity
• An unprotected message is susceptible to a modification that cannot be
detected easily
• Eve, here, changes the time that Alice wants meet Bob
• Bob will not know that the time was modified
How Encryption helps Integrity (cont.)
This message
is from Alice
How encryption helps…
• Bob can verify that the message is from
Alice since the key is shared only with her
How encryption helps…
• Eve cannot impersonate Alice since the key she uses is different from
the key that Bob shares with Alice
• Bob will find easily that the message is not from Alice!
This message
is from Alice
Cryptography for secure Email
Secure e-mail
Alice wants to send confidential e-mail, m, to Bob.
KS
KS(m ) KS(m )
m K ( .)
S
KS( ) . m
+ Internet
- KS
KS
+
KB( ). + +
-
K B( ) .
KB(KS ) KB(KS )
K+
B KB-
Alice:
generates random symmetric private key, KS.
encrypts message with KS (for efficiency)
also encrypts KS with Bob’s public key.
sends both KS(m) and KB(KS) to Bob.
8: Network Security 8-67
Secure e-mail
Alice wants to send confidential e-mail, m, to Bob.
KS
KS(m ) KS(m )
m K ( .)
S
KS( ) . m
+ Internet
- KS
KS
+
KB( ). + +
-
K B( ) .
KB(KS ) KB(KS )
K+
B KB-
Bob:
uses his private key to decrypt and recover KS
uses KS to decrypt KS(m) to recover m
KA- KA+
- -
m H(.)
-
KA( ). KA(H(m)) KA(H(m)) +
KA( ). H(m )
+ Internet
- compare
m H( ). H(m )
m
+ KS( ) .
m + Internet
KS
+
KB( ) . +
KB(KS )
K+
B
Alice uses three keys: her private key, Bob’s public key, newly
created symmetric key