CS 683 - Security and Privacy Fall 2019
Instructor: Karim Eldefrawy
University of San Francisco
http://www.cs.usfca.edu/~keldefrawy/teaching /fall2019/cs683/cs683_main.htm
1
CS 683 - Security and Privacy Fall 2019 Instructor: Karim Eldefrawy - - PowerPoint PPT Presentation
CS 683 - Security and Privacy Fall 2019 Instructor: Karim Eldefrawy University of San Francisco http://www.cs.usfca.edu/~keldefrawy/teaching /fall2019/cs683/cs683_main.htm 1 Mi Midterm rm Revi view (Le Lectures 1-8) 8) 2 Co Comp
University of San Francisco
http://www.cs.usfca.edu/~keldefrawy/teaching /fall2019/cs683/cs683_main.htm
1
2
3
Attacker or Adversary Your Computer/Phone/Tablet
Can be: individuals,
Your data: financial, health records, intellectual property …
4
communication channel
5
6
7
compromise (undermine) the security of information
designed to detect, prevent, or recover from, a security attack
data processing systems and information transfers. A “security service” makes use of one or more “security mechanisms”
– Security Attack: Eavesdropping (Interception) – Security Mechanism: Encryption – Security Service: Confidentiality
8
9
Integrity Confidentiality Availability Authenticity
10
By Injection By Deletion
11
erasure Examples of attacks on Availability: – Denial of Service (DoS) Attacks
– Malware that deletes or encrypts files
12
integrity, etc.
protect users from each other
holders (users)
à prevent insider attacks
access
13
Random Number Generator (RNG)
authentication, identification, login, payment, etc.
smartcards, VPNs, e-voting, etc.
14
is evident free of any (computational/hardness) assumptions
some common (often unproven) assumptions, e.g., the conjectured difficulty of factoring large integers
Take a look at:
http://www.ciphersbyritter.com/GLOSSARY.HTM
15
16
17
i i i n n n
1 1 1
18
19
Classified along three dimensions:
ciphertext
– Binary arithmetic: shifts, XORs, ANDs, etc.
– Integer arithmetic
– Symmetric or conventional (single key used) – Asymmetric or public-key (2 keys: 1 to encrypt, 1 to decrypt)
– One bit at a time – A string of any length – A block of bits
upon (how?)
20
plaintext ciphertext
K AB
encryption algorithm decryption algorithm
K AB
plaintext m K (m)
AB
K (m)
AB
m = K (
)
AB
without revealing it:
secret key cryptography
21
22
K AB
challenge
K AB
challenge reply
challenge challenge reply
23
mechanisms
20
25
“Round Keys” are generated from
subkey generation algorithm
security
lead to greater difficulty of cryptanalysis
the algorithm becomes a concern
26
27
banking security systems
bit key and block size
to be reversible
greater the security (to a point)
28
46
26
31
64 Bit Plaintext Initial Permutation 32 Bit L0 32 Bit R0 F(R0,K1) + 32 Bit L1 32 Bit R1 32 Bit L15 32 Bit R15 F(R15,K16) + 32 Bit L16 32 Bit R16 Final Permutation 64 Bit Ciphertext
Encryption Process
64 Bit Key Permutation Choice 1 56 Bit Key 28 Bit C0 28 Bit D0 Left Shift Right Shift C1 D1 Building Blocks Permuted Choice 2 K1(48 bits) C16 D16 Permuted Choice 2
Key Schedule
K16(48 bits)
27
DES Key size = 56 bits
8 * ~5-bit chars = 40 bits
33
Differential Cryptanalysis
Linear Cryptanalysis
Related-key Cryptanalysis
input/output Differential cryptanalysis discovered in 1990; virtually all block ciphers from before that time are vulnerable... ... except DES. IBM (and the NSA) knew about it 15 years earlier
34
ENCRYPTION
http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
35
Electronic Code-Book (ECB) Mode
Ci = E ( K, Pi ) Pi = D ( K, Ci )
36
Cipher-Block Chaining (CBC) Mode
preceding ciphertext block:
Ci = E ( K, Pi XOR Ci-1 ) C0=IV Pi = D ( K, Ci ) XOR Ci-1
37
Output Feedback (OFB) Mode
Ci = E ( K, Vi-1 ) XOR Pi V0=IV Pi = E ( K, Vi-1 ) XOR Ci
39
Cipher Feedback (CFB) Mode
Ci = Pi XOR E (K, Ci-1) C0=IV Pi = E ( K, Ci-1 ) XOR Ci
40
Counter (CTR) Mode
Ci = E ( K, CTRi ) XOR Pi CTRi = CTRi-1 + 1 Pi = E ( K, CTRi ) XOR Ci
41
Message Authentication Code (MAC) Mode
Ci = E ( K, Pi XOR Ci-1 ) C0=IV What is sent or stored: P1, . . ., Pn, Cn = MAC Receiver recomputes Cn with K and compares
42
Meet-in-the-middle (or Rendesvouz) ATTACK:
I. For each possible K’i (where 0 < i < 256) 1. Compute C’i= DES ( K’i , P ) 2. Store: [ K’i, C’i ] in table T (sorted by C’i) II. For each possible K”i (where 0 < i < 256) 1. Compute C”i = DES-1 ( K”i , C ) 2. Lookup C”i in T ç not expensive! 3. If lookup succeeds, output: K1=K’i, K2=K”i TOTAL COST: O(256) operations + O(256) storage
43
NOTE: The same variants can be constructed out of any cipher
44
“encrypt” message digest/hash -- h(m) -- with private key
44
45
plaintext message, m ciphertext encryption algorithm decryption algorithm
Bob’s public key
plaintext message PK (m)
B
PK
B
Bob’s private key
SK
B
m = SK (PK (m))
B B
SKb.
decrypt with own private key
person one communicates with
repudiation)
46
47
Ø Advantages
l only the private key must be kept secret l relatively long life time of the key l more security services l relatively efficient digital signatures mechanisms
Ø Disadvantages
l low data throughput l much larger key sizes l distribution/revocation of public keys l security based on conjectured hardness of certain
computational problems
48
“New Directions in Cryptography” 1976 * p
System wide parameters : p large prime, a generator in Z − − − Alice's secret: v, public: mod Bob's secret: w, public: mod
v a w b
y a p y a p = =
Alice has: mod Bob has: mod ( ) mod ( ) mod
w b v a v ab b w ba a
y a p y a p K y p K y p = = = = =
49
*
p v w a b vw v a
50
Decision DH Problem: mod , mod : mod
v w a b vw ab
p large prime, a generator Given : y a p y a p Distinguish K a p from a random number! − − = = =
51
Eve is passive …
p a y
v a
mod =
Secure communication with Kab Choose random v
p a y
w b
mod =
Choose random w, Compute
p y K
w a ba
mod ) ( =
Compute
( ) mod
v ab b
K y p =
52
(assume Eve is an active adversary!)
p a y
v a
mod =
Secure communication with Kab Choose random v
p a y
w b
mod =
Choose random w, Compute
p y K
w a ba
mod ) ( =
Compute
( ) mod
v ab b
K y p =
53
54
*
55
Why: n has unique factors p, q Given p and q, computing (p-1)(q-1) is easy: Use extended Euclidian! Conjecture: breaking RSA is polynomially equivalent to factoring n. Recall that n is very, very large!
56
: C - RSA ciphertext mod( 1) mod( 1) compute: mod mod and solve: mod mod
p q
p q d p d q p q
Let d d p d d q M C p M C q M M p M M q = − = − = = = = ) mod( )] mod ( ) mod ( [
1 1
pq q p p M p q q M M
q p − −
+ =
57
Cd”’ mod n = me”d”’ mod n = (m) k’ * k * phi(n) + 1 mod n = m
58
A signature scheme: (P,A,K,Sign,Verify) P - plaintext (msgs) A - signatures K - keys Sign - signing function: (P*K)->A Verify - verification function: (P*A*K) à {0,1}
Usually message hash
59
??? ) ( : ) , ( :
Verificati : ) ( : Signing , : , , : mod 1 and mod and primes (large) two are q p where pq n Let
1 * ) ( e d n
y m m y Verify y signature n mod m y m Sign m message e n Publics d q p Secrets 1) 1)(q (p (n) Φ(n) ed Φ(n) d e Z e = = = =
F º = Î ¹ =
Use the fact that, in RSA, encryption reverses “decryption”
60
61
Ø Public key
l encryption, signatures (esp., non-repudiation) and key
management
Ø Conventional
l encryption and some data integrity applications
Ø Key sizes
l Keys in public key crypto must be larger (e.g., 2048 bits for RSA)
than those in conventional crypto (e.g., 112 bits for 3-DES or 256
bits for AES)
search (brute force)
factoring large numbers in RSA)