Network Security
Security Goals?
Confidentiality: only sender, intended receiver
should “understand” message contents
sender encrypts message
receiver decrypts message
Authentication: sender, receiver want to confirm
identity of each other
Message integrity: sender, receiver want to
ensure message not altered (in transit, or
afterwards) without detection
Access and availability: services must be
accessible and available to users
8: Network Security 8-2
Active Attacks
Masquerade
Pretending to be a different entity
Replay
Modification of messages
Denial of service
Easy to detect
Detection may lead to deterrent
Hard to prevent
Active Attacks
Passive Attacks
Eavesdropping on transmissions
To obtain information
Release of message contents
Outsider learns content of transmission
Traffic analysis
Bymonitoring frequency and length of
messages, even encrypted, nature of
communication may be guessed
Difficult to detect
Can be prevented
Passive Attacks
Symmetric Encryption
(Simplified)
Ingredients
Plain text
Encryption algorithm
Secret key
Cipher text
Decryption algorithm
Requirements for Security
Strong encryption algorithm
Even if known, should not be able to decrypt
or work out key
Even if a number of cipher texts are
available together with plain texts of them
Sender and receiver must obtain secret
key securely
Once key is known, all communication
using this key is readable
Attacking Encryption
Crypt analysis
Relay on nature of algorithm plus some
knowledge of general characteristics of
plain text
Attempt to deduce plain text or key
Brute force
Tryevery possible key until plain text is
achieved
Friends and enemies: Alice, Bob,
Trudy
well-known in network security world
Bob, Alice (lovers!) want to communicate “securely”
Trudy (intruder) may intercept, delete, add messages
Alice Bob
data, control
channel
messages
data secure secure data
sender receiver
Trudy
8: Network Security 8-11
There are bad guys (and girls) out
there!
Q: What can a “bad guy” do?
A: a lot!
eavesdrop: intercept messages
actively insert messages into connection
impersonation: can fake (spoof) source
address in packet (or any field in packet)
hijacking: “take over” ongoing connection
by removing sender or receiver, inserting
himself in place
denial of service: prevent service from
being used by others (e.g., by overloading
resources)
more on this later ……
8: Network Security 8-12
Security Services
8: Network Security 8-13
Services and Mechanisms Relationship
8: Network Security 8-14
Services and Mechanisms Relationship
8: Network Security 8-15
Model for Network Access Security
8: Network Security 8-16
The language of cryptography
Alice’s Bob’s
K encryptio K decryptio
A
n Bn
key key
plaintext encryption ciphertext decryption plaintext
algorithm algorithm
symmetric key crypto: sender, receiver keys identical
public-key crypto: encryption key public, decryption
key secret (private)
8: Network Security 8-17
Symmetric key cryptography
substitution cipher: substituting one thing for another
monoalphabetic cipher: substitute one letter for another
plaintext: abcdefghijklmnopqrstuvwxyz
ciphertext: mnbvcxzasdfghjklpoiuytrewq
E.g.: Plaintext: bob. i love you. alice
ciphertext: nkn. s gktc wky. mgsbc
Q: How hard to break this simple cipher?:
brute force (how hard?)
other?
8: Network Security 8-18
Symmetric key cryptography
KA-B KA-B
plaintext encryption ciphertext decryption plaintext
message, m algorithm algorithm
K (m)
A-B
m=K (KA-B(m) )
A-B
symmetric key crypto: Bob and Alice share know
same (symmetric) key: K
A-B
e.g., key is knowing substitution pattern in mono
alphabetic substitution cipher
Q: how do Bob and Alice agree on key value?
8: Network Security 8-19
Symmetric key crypto: DES
DES: Data Encryption Standard
US encryption standard [NIST 1993]
56-bit symmetric key, 64-bit plaintext input
How secure is DES?
DES Challenge: 56-bit-key-encrypted phrase
(“Strong cryptography makes the world a safer
place”) decrypted (brute force) in 4 months
no known “backdoor” decryption approach
making DES more secure:
use three keys sequentially (3-DES) on each datum
use cipher-block chaining
8: Network Security 8-20
Symmetric key
crypto: DES
DES operation
initial permutation
16 identical “rounds” of
function application,
each using different
48 bits of key
final permutation
8: Network Security 8-21
AES: Advanced Encryption
Standard
new (Nov. 2001) symmetric-key NIST
standard, replacing DES
processes data in 128 bit blocks
128, 192, or 256 bit keys
brute force decryption (try each key)
taking 1 sec on DES, takes 149 trillion
years for AES
8: Network Security 8-22
Block Cipher
64-bit input
8bits 8bits 8bits 8bits 8bits 8bits 8bits 8bits
loop for
n rounds
T1 T2 T3 T4 T5 T6 T7 T8
8 bits 8 bits 8 bits 8 bits 8 bits 8 bits 8 bits 8 bits
one pass
64-bit scrambler
through: one
input bit
affects eight 64-bit output
output bits
multiple passes: each input bit afects all output
bits
block ciphers: DES, 3DES, AES
8: Network Security 8-23
Cipher Block Chaining
cipher block: if input m(1) = “HTTP/1.1”
t=1 block c(1) = “k329aM02”
block repeated, will cipher
produce same …
m(17) = “HTTP/1.1”
cipher text: t=17 block c(17) = “k329aM02”
cipher
cipher block chaining: XOR ith
input block, m(i), with previous
block of cipher text, c(i-1) m(i)
c(0) transmitted to receiver in clear
what happens in “HTTP/1.1”
scenario from above? c(i-1) +
block
cipher
c(i)
8: Network Security 8-24
Public key cryptography
symmetric key crypto public key
requires sender, cryptography
receiver know radically different
shared secret key approach [Diffie-
Q: how to agree on Hellman76, RSA78]
key in first place sender, receiver do
(particularly if never not share secret key
“met”)? public encryption
key known to all
private decryption
key known only to
receiver
8: Network Security 8-25
Public key cryptography
+ Bob’s public
K
B key
- Bob’s private
K
B key
plaintext encryption ciphertext decryption plaintext
message, m algorithm +
K (m)
algorithm message
- +
B m = KB (K (m))
B
8: Network Security 8-26
Public key encryption algorithms
Requirements:
+ . .
1 need KB ( ) and -K ( ) such that
B
- +
K (K (m)) = m
B B
+ be impossible
given public key K , it should
2 to compute private keyB K
-
B
RSA: Rivest, Shamir, Adleman algorithm
8: Network Security 8-27
RSA: Choosing keys
1. Choose two large prime numbers p, q.
(e.g., 1024 bits each)
2. Compute n = pq, z = (p-1)(q-1)
3. Choose e (with e<n) that has no common factors
with z. (e, z are “relatively prime”).
4. Choose d such that ed-1 is exactly divisible by z.
(in other words: ed mod z = 1 ).
5. Public key is (n,e). Private key is (n,d).
+ -
KB KB
8: Network Security 8-28
RSA: Encryption, decryption
0. Given (n,e) and (n,d) as computed above
1. To encrypt bit pattern, m, compute
e
c = me mod(i.e., remainder when m is divided by n)
n
2. To decrypt received bit pattern, c, compute
d
m = cd mod(i.e., remainder when c is divided by n)
n
Magic e mod d mod
m = (m
happens!
n) c n
8: Network Security 8-29
RSA example:
Bob chooses p=5, q=7. Then n=35, z=24.
e=5 (so e, z relatively prime).
d=29 (so ed-1 exactly divisible by z.
letter m me c = me mod n
encrypt:
l 12 1524832 17
d
decrypt:
c c m = cd mod n letter
17 481968572106750915091411825223071697 12 l
8: Network Security 8-30
RSA: Why is that m = (m e mod d mod
n) n
Useful number theory result: If p,q prime and
n = pq, then: y y mod (p-1)(q-1)
x mod n = x mod n
e
(m mod d mod n = ed
m
n) mod n
ed mod (p-1)(q-
= m
1) number theory result above)
(using
mod n
1
= m mod n
(since we chose ed to be divisible by
(p-1)(q-1) with remainder 1 )
= m
8: Network Security 8-31
RSA: another important property
The following property will be very useful later:
- + + -
K (K (m)) = m= K (K (m))
B B B B
use public key use private
first, followed key first,
by private key followed by
public key
Result is the
same!
8: Network Security 8-32