SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
Intro to Cryptography
Michael Soltys
California State University at Channel Islands
August 20, 2015 v1.1
Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 1/45
WEP, WPA/WPA2 SSL/SSH
PGP/GPG
RSA Encryption 128 bytes:
BE 89 0E A1 AD FA 7D 58 6A A1 6A E4
3B ED 75 E4 3E F2 19 F7 F3 0F FA D9
EF 62 10 52 7B FC DD 94 96 A8 35 6B
1B 50 60 2E 2E 79 AC 7C 2E A3 81 DE
8D 37 F9 EE 6E 4F 82 C7 E4 12 04 55
AF 57 69 94 8C EF 2E 50 7A 6D 53 0F
5B 5F 62 58 5E CF F2 DF F4 4D CE 71
B6 82 D7 86 E5 4F 77 E4 91 AA E4 BD
5A 65 AA 9E 20 4F 38 5E B4 8B E0 36
45 80 A8 D5 24 5C 46 9D F1 80 C0 6B
62 A5 1F 26 5E AE 17 47
DRM
FairPlay
MD5
5c3079df8a48623f5aa10f0181a7ab03
Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 2/45
We know how to do crypto scientifically
→ and it is a huge help
But, in practice most security problems due to buggy code
→ writing software that is not buggy is the problem of
CS/SE
Challenge 1: build secure systems with insecure components
→ similar to building reliable systems with unreliable
components
Challenge 2: the art of making the right trade-offs to satisfy
contradictory objectives (e.g., security & speed)
Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 3/45
Cryptography is the art of computing & communicating in the
presence of an adversary
cryptography = κρυπτo (hidden or secret) + γραφη (writing)
Three broad applications:
encryption
authentication
integrity checking
Not all security is an application of crypto, e.g., Firewalls.
Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 4/45
Fundamental TENET of cryptography
Lots of smart people have been trying to figure out how
to break X,
but so far they have not been able to come up with anything yet.
Therefore X is “secure” . . .
Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 5/45
Fundamental ASSUMPTION of cryptography
Everybody knows how it works, i.e., the algorithm is public
knowledge.
The secret is the “key”.
In principle it can always be broken; but in practice it is too much
work for the “bad guy.”
Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 6/45
Great free tools to practice the ideas presented in these slides:
GnuPG (http://www.gnupg.org)
OpenSSL (http://www.openssl.org)
Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 7/45
plaintext
encryption
−→ ciphertext
decryption
−→ plaintext
Caesar cipher: key a secret number between 1 and 25.
Monoalphabetic cipher: key a secret pairing — 26! ≈ 1026
Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 8/45
Three basic attacks:
ciphertext only
known plaintext
chosen plaintext
Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 9/45
Three types of cryptographic functions:
hash functions (0 keys)
secret functions (1 key)
public key functions (2 keys)
Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 10/45
Secret (Symmetric) key crypto
plaintext
encryption
decryption
key
ciphertext
plaintext ciphertext
Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 11/45
Public (Asymmetric) key crypto
private key
encryption
plaintext ciphertext
ciphertext plaintext
decryption
public key
Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 12/45
Digital signature scheme
public key
plaintext
signing
signed message
plaintextsigned message
verification
private key
Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 13/45
Symmetric Ciphers
Substitutions
Permutations
XOR
Crypto - Michael Soltys August 10, 2015 v1.1 Symmetric ciphers - 14/45
Rounds of substitutions & permutations
Crypto - Michael Soltys August 10, 2015 v1.1 Symmetric ciphers - 15/45
XOR, exclusive OR
x y x ⊕ y
0 0 0
0 1 1
1 0 1
1 1 0
If a, b ∈ {0, 1}n then a ⊕ b is a string in {0, 1}n where the i-th bit
is ai ⊕ bi
Bit-wise XOR
Can also Bit-wise XOR a stream
Crypto - Michael Soltys August 10, 2015 v1.1 Symmetric ciphers - 16/45
DES (1977)
“Data Encryption Standard”
IBM’s cipher + NSA =⇒ DES
DES
56 bits
key
64 bits
input
64 bits
output
Technically, key is also 64 bits, but each octet is
x1 x2 x3 x4 x5 x6 x7 y where y = 7
i=1 xi .
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 17/45
inverse of original permutation
64−bit input
permutation
Round 1
Round 2
Round 16
Generate 16 keys, each
of 48−bits from the
initial 56−bits
56−bit key
swap left & right sides
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 18/45
4
32−bit L
32−bit R
32−bit R
Mangler
Function
32−bit L nn
n+1 n+1
+
Kn
1
2
3
Reversible “Feistel cipher.”
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 19/45
Example: Apache HTTP server access
.htaccess & .htpasswd
Can create a (variant of) DES login/password pair:
htpasswd -cbd ./.htpasswd crypto 7u3pr4aa
and the result is is the file .htpasswd containing:
crypto:9.ZzClMRzHfmc
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 20/45
On:
http://www.cas.mcmaster.ca/~soltys/cs3c03-w13/ReadingList
.htpasswd consists of:
netsec2013:$apr1$fr2JPfTa$HEzejdyg5DE2MFGVCIzd21
created with command:
htpasswd -cbm ./.htpasswd netsec2013 tigerblood
which produces an MD5 hash
-d is crypt() a variant of DES
-m is MD5
-s is SHA1
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 21/45
crypt() function
man 3 crypt for details
password truncated to 8 letters
each encoded with 7 (ASCII)
bits
giving 56 bits of input
salt used to “perturb”
displayed in Base64
64 bits
DES
DES
DES
DES
64 bits of 0s 56 bit passwd
1
2
25
3
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 22/45
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 23/45
h = crypt("passwd","h")
perl -e ’print crypt("7u3pr4aa"," 9. ZzClMRzHfmc ")’
outputs eYZUcvy1BSUak
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 24/45
Challenge
Who can break break crypt() htpasswd corresponding to:
.DubBN4dRdP7w
Crypto - Michael Soltys August 10, 2015 v1.1 DES - 25/45
AES
NIST: National Institute of Standards
“Rijndael”
FIPS 2001
AES-128, AES-192, AES-256
Crypto - Michael Soltys August 10, 2015 v1.1 AES - 26/45
Block ciphers
Encrypting messages longer than 64 bits (KPS, chp 4)
1. Electronic Code Book (ECB)
2. Cipher Block Chaining (CBC)
3. k-bit Cipher Feedback Mode (CFB)
4. k-bit Output Feedback Mode (OFB)
5. Counter Mode (CTR)
Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 27/45
ECB
K
message...
m m m m mm1 2 3 4 5 6
e e e e e e1 2 3 4 5 6
Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 28/45
Plaintext ECB
Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 29/45
CBC
K
m m m m
IV
c c c c1 2 3 4
1 2 3 4
enc enc enc enc
xor xor xor xor
K K K
Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 30/45
Plaintext ECB CBC
Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 31/45
Stream ciphers: RC4
Message m and one-time pad p both in {0, 1}n.
A stream cipher generates successive bits pi to encode a stream of
bits mi as ci = mi ⊕ pi .
Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 32/45
(Keep in mind that 28 = 256)
let S[i] be an array of octets (i.e., bytes)
Initialize S:
for i=0 . . . 255
S[i]=i
end for
j=0
for i=0 . . . 255
j=(j+S[i]+key[i mod keylength]) mod 256
swap S[i] and S[j]
end for
Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 33/45
Generate pseudo-random bit stream (byte at a time)
i=0
j=0
while "next byte needed"
i=(i+1) mod 256
j=(j+S[i]) mod 256
swap S[i] and S[j]
k=S[(S[i]+S[j]) mod 256]
output k
end while
Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 34/45
802.11 Wireless Networks Security
WEP (Wired Equivalent Privacy) uses RC4 — deprecated!
WPA (Wi-Fi Protected Access)
WPA uses RC4-type called TKIP (larger keys than WEP)
WPA2 uses AES
WPA/WPA2 part of 802.11i as of 2004.
Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 35/45
WEP
"ciphertext"
Init
Vector
"one−time pad" = "keystream"
00101101011101011000101110...
"plaintext" 110111001011000111100100...
+
1111000111000100011...
=
RC4Key
(IV)
concatenation
|
Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 36/45
openssl ciphers -v
Name; Protocol; Kx=key exchange; Au=authentication; Enc=encryption; Mac=message digest
DHE-RSA-AES256-SHA SSLv3 Kx=DH Au=RSA Enc=AES(256) Mac=SHA1
DHE-DSS-AES256-SHA SSLv3 Kx=DH Au=DSS Enc=AES(256) Mac=SHA1
AES256-SHA SSLv3 Kx=RSA Au=RSA Enc=AES(256) Mac=SHA1
EDH-RSA-DES-CBC3-SHA SSLv3 Kx=DH Au=RSA Enc=3DES(168) Mac=SHA1
EDH-DSS-DES-CBC3-SHA SSLv3 Kx=DH Au=DSS Enc=3DES(168) Mac=SHA1
DES-CBC3-SHA SSLv3 Kx=RSA Au=RSA Enc=3DES(168) Mac=SHA1
DES-CBC3-MD5 SSLv2 Kx=RSA Au=RSA Enc=3DES(168) Mac=MD5
DHE-RSA-AES128-SHA SSLv3 Kx=DH Au=RSA Enc=AES(128) Mac=SHA1
DHE-DSS-AES128-SHA SSLv3 Kx=DH Au=DSS Enc=AES(128) Mac=SHA1
AES128-SHA SSLv3 Kx=RSA Au=RSA Enc=AES(128) Mac=SHA1
DHE-RSA-SEED-SHA SSLv3 Kx=DH Au=RSA Enc=SEED(128) Mac=SHA1
DHE-DSS-SEED-SHA SSLv3 Kx=DH Au=DSS Enc=SEED(128) Mac=SHA1
SEED-SHA SSLv3 Kx=RSA Au=RSA Enc=SEED(128) Mac=SHA1
RC2-CBC-MD5 SSLv2 Kx=RSA Au=RSA Enc=RC2(128) Mac=MD5
RC4-SHA SSLv3 Kx=RSA Au=RSA Enc=RC4(128) Mac=SHA1
RC4-MD5 SSLv3 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5
RC4-MD5 SSLv2 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5
EDH-RSA-DES-CBC-SHA SSLv3 Kx=DH Au=RSA Enc=DES(56) Mac=SHA1
EDH-DSS-DES-CBC-SHA SSLv3 Kx=DH Au=DSS Enc=DES(56) Mac=SHA1
DES-CBC-SHA SSLv3 Kx=RSA Au=RSA Enc=DES(56) Mac=SHA1
DES-CBC-MD5 SSLv2 Kx=RSA Au=RSA Enc=DES(56) Mac=MD5
EXP-EDH-RSA-DES-CBC-SHA SSLv3 Kx=DH(512) Au=RSA Enc=DES(40) Mac=SHA1 export
EXP-EDH-DSS-DES-CBC-SHA SSLv3 Kx=DH(512) Au=DSS Enc=DES(40) Mac=SHA1 export
EXP-DES-CBC-SHA SSLv3 Kx=RSA(512) Au=RSA Enc=DES(40) Mac=SHA1 export
EXP-RC2-CBC-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC2(40) Mac=MD5 export
EXP-RC2-CBC-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC2(40) Mac=MD5 export
EXP-RC4-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export
EXP-RC4-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export
Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 37/45
Public Key Crypto
Diffie-Hellman
ElGamal
RSA
Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 38/45
Diffie-Hellman Key Exchange
Oldest public key cryptosystem still in use.
Allows two individuals to agree on a shared key, even though
they can only exchange messages in public.
A weakness is that there is no authentication; the other might
be a “bad guy.”
Described in RFC 2631
Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 39/45
0
2
4
6
8
10
12
14
16
0 2 4 6 8 10 12 14 16
"primitive.txt"
Plot of log3(x) over Z17.
Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 40/45
Alice Bob
1 Public: p, g such that Zp = g
2 Choose secret a Choose secret b
3 Computer A := ga Compute B := gb
4 Send A to Bob −→ ←− Send B to Alice
5 Compute Ba Compute Ab
Alice & Bob have shared value
6 Ab = (ga)b = gab = gba = (gb)a = Ba
Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 41/45
1. Alice and Bob agree to use a prime p = 23 and base g = 5.
2. Alice chooses secret a = 8; sends Bob A = ga (mod p)
2.1 A = 58
(mod 23)
2.2 A = 16
3. Bob chooses secret b = 15; sends Alice B = gb (mod p)
3.1 B = 515
(mod 23)
3.2 B = 19
4. Alice computes s = Ba (mod p)
4.1 s = 198
(mod 23)
4.2 s = 9
5. Bob computes s = Ab (mod p)
5.1 s = 1615
(mod 23)
5.2 s = 9
Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 42/45
Computing large powers in (Zn, ∗) can be done efficiently with
repeated squaring—for example, if (m)b = cr . . . c1c0, then
compute
a0 = a, a1 = a2
0, a2 = a2
1, . . . , ar = a2
r−1 (mod n),
and so am = ac0
0 ac1
1 · · · acr
r (mod n).
Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 43/45
DH only resists passive adversaries.
A passive attack is one in which the intruder eavesdrops but does
not modify the message stream in any way.
An active attack is one in which the intruder may:
transmit messages
replay old messages
modify messages in transit
delete selected messages from the wire
A typical active attack is one in which an intruder impersonates
one end of the conversation, or acts as a man-in-the-middle. This
attack motivates the need for authentication.
Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 44/45
How to do a “man-in-the-middle” on DH?
Alice Eve Bob
gSA = 8389 gSX = 5876 gSB = 9267
8389 −→ 5876 −→
5876 ←− 9267 ←−
Shared key
KAX = 5876SA = 8389SX
and shared key
KBX = 9267SX = 5876SB
Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 45/45

Contenu connexe

En vedette

Fair ranking in competitive bidding procurement: a case analysis
Fair ranking in competitive bidding procurement: a case analysisFair ranking in competitive bidding procurement: a case analysis
Fair ranking in competitive bidding procurement: a case analysisMichael Soltys
 
Feasible Combinatorial Matrix Theory - LICS2013 presentation
Feasible Combinatorial Matrix Theory - LICS2013 presentationFeasible Combinatorial Matrix Theory - LICS2013 presentation
Feasible Combinatorial Matrix Theory - LICS2013 presentationMichael Soltys
 
A formal framework for Stringology
A formal framework for StringologyA formal framework for Stringology
A formal framework for StringologyMichael Soltys
 
The proof theoretic strength of the Steinitz exchange theorem - EACA 2006
The proof theoretic strength of the Steinitz exchange theorem - EACA 2006The proof theoretic strength of the Steinitz exchange theorem - EACA 2006
The proof theoretic strength of the Steinitz exchange theorem - EACA 2006Michael Soltys
 
The Proof Complexity of Linear Algebra - LICS 2002
The Proof Complexity of Linear Algebra - LICS 2002The Proof Complexity of Linear Algebra - LICS 2002
The Proof Complexity of Linear Algebra - LICS 2002Michael Soltys
 
Unambiguous functions in logarithmic space - CiE 2009
Unambiguous functions in logarithmic space - CiE 2009Unambiguous functions in logarithmic space - CiE 2009
Unambiguous functions in logarithmic space - CiE 2009Michael Soltys
 
Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Michael Soltys
 
La, permutations, and the hajós calculus - ICALP 2004
La, permutations, and the hajós calculus - ICALP 2004La, permutations, and the hajós calculus - ICALP 2004
La, permutations, and the hajós calculus - ICALP 2004Michael Soltys
 
Games on Posets - CiE 2008
Games on Posets - CiE 2008Games on Posets - CiE 2008
Games on Posets - CiE 2008Michael Soltys
 
Forced repetitions over alphabet lists
Forced repetitions over alphabet listsForced repetitions over alphabet lists
Forced repetitions over alphabet listsMichael Soltys
 
How Safe is your Data?
How Safe is your Data?How Safe is your Data?
How Safe is your Data?Michael Soltys
 
Circuit Complexity of Shuffle - IWOCA 2013
Circuit Complexity of Shuffle - IWOCA 2013Circuit Complexity of Shuffle - IWOCA 2013
Circuit Complexity of Shuffle - IWOCA 2013Michael Soltys
 
An algorithmic view of Computer Science
An algorithmic view of Computer ScienceAn algorithmic view of Computer Science
An algorithmic view of Computer ScienceMichael Soltys
 
Feasible proofs of matrix identities with csanky's algorithm - CSL 2005
Feasible proofs of matrix identities with csanky's algorithm - CSL 2005Feasible proofs of matrix identities with csanky's algorithm - CSL 2005
Feasible proofs of matrix identities with csanky's algorithm - CSL 2005Michael Soltys
 

En vedette (15)

Fair ranking in competitive bidding procurement: a case analysis
Fair ranking in competitive bidding procurement: a case analysisFair ranking in competitive bidding procurement: a case analysis
Fair ranking in competitive bidding procurement: a case analysis
 
Feasible Combinatorial Matrix Theory - LICS2013 presentation
Feasible Combinatorial Matrix Theory - LICS2013 presentationFeasible Combinatorial Matrix Theory - LICS2013 presentation
Feasible Combinatorial Matrix Theory - LICS2013 presentation
 
Algorithms on Strings
Algorithms on StringsAlgorithms on Strings
Algorithms on Strings
 
A formal framework for Stringology
A formal framework for StringologyA formal framework for Stringology
A formal framework for Stringology
 
The proof theoretic strength of the Steinitz exchange theorem - EACA 2006
The proof theoretic strength of the Steinitz exchange theorem - EACA 2006The proof theoretic strength of the Steinitz exchange theorem - EACA 2006
The proof theoretic strength of the Steinitz exchange theorem - EACA 2006
 
The Proof Complexity of Linear Algebra - LICS 2002
The Proof Complexity of Linear Algebra - LICS 2002The Proof Complexity of Linear Algebra - LICS 2002
The Proof Complexity of Linear Algebra - LICS 2002
 
Unambiguous functions in logarithmic space - CiE 2009
Unambiguous functions in logarithmic space - CiE 2009Unambiguous functions in logarithmic space - CiE 2009
Unambiguous functions in logarithmic space - CiE 2009
 
Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System -
 
La, permutations, and the hajós calculus - ICALP 2004
La, permutations, and the hajós calculus - ICALP 2004La, permutations, and the hajós calculus - ICALP 2004
La, permutations, and the hajós calculus - ICALP 2004
 
Games on Posets - CiE 2008
Games on Posets - CiE 2008Games on Posets - CiE 2008
Games on Posets - CiE 2008
 
Forced repetitions over alphabet lists
Forced repetitions over alphabet listsForced repetitions over alphabet lists
Forced repetitions over alphabet lists
 
How Safe is your Data?
How Safe is your Data?How Safe is your Data?
How Safe is your Data?
 
Circuit Complexity of Shuffle - IWOCA 2013
Circuit Complexity of Shuffle - IWOCA 2013Circuit Complexity of Shuffle - IWOCA 2013
Circuit Complexity of Shuffle - IWOCA 2013
 
An algorithmic view of Computer Science
An algorithmic view of Computer ScienceAn algorithmic view of Computer Science
An algorithmic view of Computer Science
 
Feasible proofs of matrix identities with csanky's algorithm - CSL 2005
Feasible proofs of matrix identities with csanky's algorithm - CSL 2005Feasible proofs of matrix identities with csanky's algorithm - CSL 2005
Feasible proofs of matrix identities with csanky's algorithm - CSL 2005
 

Similaire à Intro to Cryptography

Eliptic-Curve Cryptography and the Internet
Eliptic-Curve Cryptography and the InternetEliptic-Curve Cryptography and the Internet
Eliptic-Curve Cryptography and the InternetOwaspCzech
 
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...Amazon Web Services
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS SecurityAaron Zauner
 
Securing Data in Transit -
Securing Data in Transit - Securing Data in Transit -
Securing Data in Transit - wolfSSL
 
SSL/TLS Eavesdropping with Fullpath Control
SSL/TLS Eavesdropping with Fullpath ControlSSL/TLS Eavesdropping with Fullpath Control
SSL/TLS Eavesdropping with Fullpath ControlMike Thompson
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS SecurityAaron Zauner
 
WiFi practical hacking "Show me the passwords!"
WiFi practical hacking "Show me the passwords!"WiFi practical hacking "Show me the passwords!"
WiFi practical hacking "Show me the passwords!"DefCamp
 
Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Aaron Zauner
 
Segurança da era do ssl everywhere
Segurança da era do ssl everywhereSegurança da era do ssl everywhere
Segurança da era do ssl everywhererodolfovillordo
 
OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)Shteryana Shopova
 
IDS-ETHZ - NSG-IDS-REPORTING_of_year_2015
IDS-ETHZ - NSG-IDS-REPORTING_of_year_2015IDS-ETHZ - NSG-IDS-REPORTING_of_year_2015
IDS-ETHZ - NSG-IDS-REPORTING_of_year_2015Christian Hallqvist
 
LibreSSL, one year later
LibreSSL, one year laterLibreSSL, one year later
LibreSSL, one year laterGiovanni Bechis
 
Dealing with pervasive monitoring - Networkshop44
Dealing with pervasive monitoring - Networkshop44Dealing with pervasive monitoring - Networkshop44
Dealing with pervasive monitoring - Networkshop44Jisc
 
Vincent Kok - Microservices 5 things I wish I'd known - Codemotion Milan 2017
Vincent Kok - Microservices 5 things I wish I'd known - Codemotion Milan 2017Vincent Kok - Microservices 5 things I wish I'd known - Codemotion Milan 2017
Vincent Kok - Microservices 5 things I wish I'd known - Codemotion Milan 2017Codemotion
 
Microservices: 5 Things I Wish I'd Known - Code Motion Milan 2017
Microservices: 5 Things I Wish I'd Known - Code Motion Milan 2017Microservices: 5 Things I Wish I'd Known - Code Motion Milan 2017
Microservices: 5 Things I Wish I'd Known - Code Motion Milan 2017Vincent Kok
 
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 [Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 Aaron Zauner
 
NetFlow Monitoring for Cyber Threat Defense
NetFlow Monitoring for Cyber Threat DefenseNetFlow Monitoring for Cyber Threat Defense
NetFlow Monitoring for Cyber Threat DefenseCisco Canada
 
HTTPS: All you need to know
HTTPS: All you need to knowHTTPS: All you need to know
HTTPS: All you need to knowOVHcloud
 
Chapter 9 cryptography- symetric encryption
Chapter 9   cryptography- symetric encryptionChapter 9   cryptography- symetric encryption
Chapter 9 cryptography- symetric encryptionSyaiful Ahdan
 

Similaire à Intro to Cryptography (20)

Eliptic-Curve Cryptography and the Internet
Eliptic-Curve Cryptography and the InternetEliptic-Curve Cryptography and the Internet
Eliptic-Curve Cryptography and the Internet
 
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...
AWS re:Invent 2016: Encryption: It Was the Best of Controls, It Was the Worst...
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS Security
 
Securing Data in Transit -
Securing Data in Transit - Securing Data in Transit -
Securing Data in Transit -
 
SSL/TLS Eavesdropping with Fullpath Control
SSL/TLS Eavesdropping with Fullpath ControlSSL/TLS Eavesdropping with Fullpath Control
SSL/TLS Eavesdropping with Fullpath Control
 
Introduction to and survey of TLS Security
Introduction to and survey of TLS SecurityIntroduction to and survey of TLS Security
Introduction to and survey of TLS Security
 
WiFi practical hacking "Show me the passwords!"
WiFi practical hacking "Show me the passwords!"WiFi practical hacking "Show me the passwords!"
WiFi practical hacking "Show me the passwords!"
 
Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)Introduction to and survey of TLS security (BsidesHH 2014)
Introduction to and survey of TLS security (BsidesHH 2014)
 
Basics of ssl
Basics of sslBasics of ssl
Basics of ssl
 
Segurança da era do ssl everywhere
Segurança da era do ssl everywhereSegurança da era do ssl everywhere
Segurança da era do ssl everywhere
 
OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)
 
IDS-ETHZ - NSG-IDS-REPORTING_of_year_2015
IDS-ETHZ - NSG-IDS-REPORTING_of_year_2015IDS-ETHZ - NSG-IDS-REPORTING_of_year_2015
IDS-ETHZ - NSG-IDS-REPORTING_of_year_2015
 
LibreSSL, one year later
LibreSSL, one year laterLibreSSL, one year later
LibreSSL, one year later
 
Dealing with pervasive monitoring - Networkshop44
Dealing with pervasive monitoring - Networkshop44Dealing with pervasive monitoring - Networkshop44
Dealing with pervasive monitoring - Networkshop44
 
Vincent Kok - Microservices 5 things I wish I'd known - Codemotion Milan 2017
Vincent Kok - Microservices 5 things I wish I'd known - Codemotion Milan 2017Vincent Kok - Microservices 5 things I wish I'd known - Codemotion Milan 2017
Vincent Kok - Microservices 5 things I wish I'd known - Codemotion Milan 2017
 
Microservices: 5 Things I Wish I'd Known - Code Motion Milan 2017
Microservices: 5 Things I Wish I'd Known - Code Motion Milan 2017Microservices: 5 Things I Wish I'd Known - Code Motion Milan 2017
Microservices: 5 Things I Wish I'd Known - Code Motion Milan 2017
 
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014 [Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
[Attacks Part] BetterCrypto Workshop @ Hack.lu 2014
 
NetFlow Monitoring for Cyber Threat Defense
NetFlow Monitoring for Cyber Threat DefenseNetFlow Monitoring for Cyber Threat Defense
NetFlow Monitoring for Cyber Threat Defense
 
HTTPS: All you need to know
HTTPS: All you need to knowHTTPS: All you need to know
HTTPS: All you need to know
 
Chapter 9 cryptography- symetric encryption
Chapter 9   cryptography- symetric encryptionChapter 9   cryptography- symetric encryption
Chapter 9 cryptography- symetric encryption
 

Dernier

Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...nirzagarg
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls DubaiEscorts Call Girls
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftAanSulistiyo
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...SUHANI PANDEY
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 

Dernier (20)

Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 

Intro to Cryptography

  • 1. Intro to Cryptography Michael Soltys California State University at Channel Islands August 20, 2015 v1.1 Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 1/45
  • 2. WEP, WPA/WPA2 SSL/SSH PGP/GPG RSA Encryption 128 bytes: BE 89 0E A1 AD FA 7D 58 6A A1 6A E4 3B ED 75 E4 3E F2 19 F7 F3 0F FA D9 EF 62 10 52 7B FC DD 94 96 A8 35 6B 1B 50 60 2E 2E 79 AC 7C 2E A3 81 DE 8D 37 F9 EE 6E 4F 82 C7 E4 12 04 55 AF 57 69 94 8C EF 2E 50 7A 6D 53 0F 5B 5F 62 58 5E CF F2 DF F4 4D CE 71 B6 82 D7 86 E5 4F 77 E4 91 AA E4 BD 5A 65 AA 9E 20 4F 38 5E B4 8B E0 36 45 80 A8 D5 24 5C 46 9D F1 80 C0 6B 62 A5 1F 26 5E AE 17 47 DRM FairPlay MD5 5c3079df8a48623f5aa10f0181a7ab03 Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 2/45
  • 3. We know how to do crypto scientifically → and it is a huge help But, in practice most security problems due to buggy code → writing software that is not buggy is the problem of CS/SE Challenge 1: build secure systems with insecure components → similar to building reliable systems with unreliable components Challenge 2: the art of making the right trade-offs to satisfy contradictory objectives (e.g., security & speed) Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 3/45
  • 4. Cryptography is the art of computing & communicating in the presence of an adversary cryptography = κρυπτo (hidden or secret) + γραφη (writing) Three broad applications: encryption authentication integrity checking Not all security is an application of crypto, e.g., Firewalls. Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 4/45
  • 5. Fundamental TENET of cryptography Lots of smart people have been trying to figure out how to break X, but so far they have not been able to come up with anything yet. Therefore X is “secure” . . . Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 5/45
  • 6. Fundamental ASSUMPTION of cryptography Everybody knows how it works, i.e., the algorithm is public knowledge. The secret is the “key”. In principle it can always be broken; but in practice it is too much work for the “bad guy.” Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 6/45
  • 7. Great free tools to practice the ideas presented in these slides: GnuPG (http://www.gnupg.org) OpenSSL (http://www.openssl.org) Crypto - Michael Soltys August 10, 2015 v1.1 Introduction - 7/45
  • 8. plaintext encryption −→ ciphertext decryption −→ plaintext Caesar cipher: key a secret number between 1 and 25. Monoalphabetic cipher: key a secret pairing — 26! ≈ 1026 Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 8/45
  • 9. Three basic attacks: ciphertext only known plaintext chosen plaintext Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 9/45
  • 10. Three types of cryptographic functions: hash functions (0 keys) secret functions (1 key) public key functions (2 keys) Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 10/45
  • 11. Secret (Symmetric) key crypto plaintext encryption decryption key ciphertext plaintext ciphertext Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 11/45
  • 12. Public (Asymmetric) key crypto private key encryption plaintext ciphertext ciphertext plaintext decryption public key Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 12/45
  • 13. Digital signature scheme public key plaintext signing signed message plaintextsigned message verification private key Crypto - Michael Soltys August 10, 2015 v1.1 Basic ciphers - 13/45
  • 14. Symmetric Ciphers Substitutions Permutations XOR Crypto - Michael Soltys August 10, 2015 v1.1 Symmetric ciphers - 14/45
  • 15. Rounds of substitutions & permutations Crypto - Michael Soltys August 10, 2015 v1.1 Symmetric ciphers - 15/45
  • 16. XOR, exclusive OR x y x ⊕ y 0 0 0 0 1 1 1 0 1 1 1 0 If a, b ∈ {0, 1}n then a ⊕ b is a string in {0, 1}n where the i-th bit is ai ⊕ bi Bit-wise XOR Can also Bit-wise XOR a stream Crypto - Michael Soltys August 10, 2015 v1.1 Symmetric ciphers - 16/45
  • 17. DES (1977) “Data Encryption Standard” IBM’s cipher + NSA =⇒ DES DES 56 bits key 64 bits input 64 bits output Technically, key is also 64 bits, but each octet is x1 x2 x3 x4 x5 x6 x7 y where y = 7 i=1 xi . Crypto - Michael Soltys August 10, 2015 v1.1 DES - 17/45
  • 18. inverse of original permutation 64−bit input permutation Round 1 Round 2 Round 16 Generate 16 keys, each of 48−bits from the initial 56−bits 56−bit key swap left & right sides Crypto - Michael Soltys August 10, 2015 v1.1 DES - 18/45
  • 19. 4 32−bit L 32−bit R 32−bit R Mangler Function 32−bit L nn n+1 n+1 + Kn 1 2 3 Reversible “Feistel cipher.” Crypto - Michael Soltys August 10, 2015 v1.1 DES - 19/45
  • 20. Example: Apache HTTP server access .htaccess & .htpasswd Can create a (variant of) DES login/password pair: htpasswd -cbd ./.htpasswd crypto 7u3pr4aa and the result is is the file .htpasswd containing: crypto:9.ZzClMRzHfmc Crypto - Michael Soltys August 10, 2015 v1.1 DES - 20/45
  • 21. On: http://www.cas.mcmaster.ca/~soltys/cs3c03-w13/ReadingList .htpasswd consists of: netsec2013:$apr1$fr2JPfTa$HEzejdyg5DE2MFGVCIzd21 created with command: htpasswd -cbm ./.htpasswd netsec2013 tigerblood which produces an MD5 hash -d is crypt() a variant of DES -m is MD5 -s is SHA1 Crypto - Michael Soltys August 10, 2015 v1.1 DES - 21/45
  • 22. crypt() function man 3 crypt for details password truncated to 8 letters each encoded with 7 (ASCII) bits giving 56 bits of input salt used to “perturb” displayed in Base64 64 bits DES DES DES DES 64 bits of 0s 56 bit passwd 1 2 25 3 Crypto - Michael Soltys August 10, 2015 v1.1 DES - 22/45
  • 23. Crypto - Michael Soltys August 10, 2015 v1.1 DES - 23/45
  • 24. h = crypt("passwd","h") perl -e ’print crypt("7u3pr4aa"," 9. ZzClMRzHfmc ")’ outputs eYZUcvy1BSUak Crypto - Michael Soltys August 10, 2015 v1.1 DES - 24/45
  • 25. Challenge Who can break break crypt() htpasswd corresponding to: .DubBN4dRdP7w Crypto - Michael Soltys August 10, 2015 v1.1 DES - 25/45
  • 26. AES NIST: National Institute of Standards “Rijndael” FIPS 2001 AES-128, AES-192, AES-256 Crypto - Michael Soltys August 10, 2015 v1.1 AES - 26/45
  • 27. Block ciphers Encrypting messages longer than 64 bits (KPS, chp 4) 1. Electronic Code Book (ECB) 2. Cipher Block Chaining (CBC) 3. k-bit Cipher Feedback Mode (CFB) 4. k-bit Output Feedback Mode (OFB) 5. Counter Mode (CTR) Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 27/45
  • 28. ECB K message... m m m m mm1 2 3 4 5 6 e e e e e e1 2 3 4 5 6 Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 28/45
  • 29. Plaintext ECB Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 29/45
  • 30. CBC K m m m m IV c c c c1 2 3 4 1 2 3 4 enc enc enc enc xor xor xor xor K K K Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 30/45
  • 31. Plaintext ECB CBC Crypto - Michael Soltys August 10, 2015 v1.1 Block ciphers - 31/45
  • 32. Stream ciphers: RC4 Message m and one-time pad p both in {0, 1}n. A stream cipher generates successive bits pi to encode a stream of bits mi as ci = mi ⊕ pi . Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 32/45
  • 33. (Keep in mind that 28 = 256) let S[i] be an array of octets (i.e., bytes) Initialize S: for i=0 . . . 255 S[i]=i end for j=0 for i=0 . . . 255 j=(j+S[i]+key[i mod keylength]) mod 256 swap S[i] and S[j] end for Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 33/45
  • 34. Generate pseudo-random bit stream (byte at a time) i=0 j=0 while "next byte needed" i=(i+1) mod 256 j=(j+S[i]) mod 256 swap S[i] and S[j] k=S[(S[i]+S[j]) mod 256] output k end while Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 34/45
  • 35. 802.11 Wireless Networks Security WEP (Wired Equivalent Privacy) uses RC4 — deprecated! WPA (Wi-Fi Protected Access) WPA uses RC4-type called TKIP (larger keys than WEP) WPA2 uses AES WPA/WPA2 part of 802.11i as of 2004. Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 35/45
  • 36. WEP "ciphertext" Init Vector "one−time pad" = "keystream" 00101101011101011000101110... "plaintext" 110111001011000111100100... + 1111000111000100011... = RC4Key (IV) concatenation | Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 36/45
  • 37. openssl ciphers -v Name; Protocol; Kx=key exchange; Au=authentication; Enc=encryption; Mac=message digest DHE-RSA-AES256-SHA SSLv3 Kx=DH Au=RSA Enc=AES(256) Mac=SHA1 DHE-DSS-AES256-SHA SSLv3 Kx=DH Au=DSS Enc=AES(256) Mac=SHA1 AES256-SHA SSLv3 Kx=RSA Au=RSA Enc=AES(256) Mac=SHA1 EDH-RSA-DES-CBC3-SHA SSLv3 Kx=DH Au=RSA Enc=3DES(168) Mac=SHA1 EDH-DSS-DES-CBC3-SHA SSLv3 Kx=DH Au=DSS Enc=3DES(168) Mac=SHA1 DES-CBC3-SHA SSLv3 Kx=RSA Au=RSA Enc=3DES(168) Mac=SHA1 DES-CBC3-MD5 SSLv2 Kx=RSA Au=RSA Enc=3DES(168) Mac=MD5 DHE-RSA-AES128-SHA SSLv3 Kx=DH Au=RSA Enc=AES(128) Mac=SHA1 DHE-DSS-AES128-SHA SSLv3 Kx=DH Au=DSS Enc=AES(128) Mac=SHA1 AES128-SHA SSLv3 Kx=RSA Au=RSA Enc=AES(128) Mac=SHA1 DHE-RSA-SEED-SHA SSLv3 Kx=DH Au=RSA Enc=SEED(128) Mac=SHA1 DHE-DSS-SEED-SHA SSLv3 Kx=DH Au=DSS Enc=SEED(128) Mac=SHA1 SEED-SHA SSLv3 Kx=RSA Au=RSA Enc=SEED(128) Mac=SHA1 RC2-CBC-MD5 SSLv2 Kx=RSA Au=RSA Enc=RC2(128) Mac=MD5 RC4-SHA SSLv3 Kx=RSA Au=RSA Enc=RC4(128) Mac=SHA1 RC4-MD5 SSLv3 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5 RC4-MD5 SSLv2 Kx=RSA Au=RSA Enc=RC4(128) Mac=MD5 EDH-RSA-DES-CBC-SHA SSLv3 Kx=DH Au=RSA Enc=DES(56) Mac=SHA1 EDH-DSS-DES-CBC-SHA SSLv3 Kx=DH Au=DSS Enc=DES(56) Mac=SHA1 DES-CBC-SHA SSLv3 Kx=RSA Au=RSA Enc=DES(56) Mac=SHA1 DES-CBC-MD5 SSLv2 Kx=RSA Au=RSA Enc=DES(56) Mac=MD5 EXP-EDH-RSA-DES-CBC-SHA SSLv3 Kx=DH(512) Au=RSA Enc=DES(40) Mac=SHA1 export EXP-EDH-DSS-DES-CBC-SHA SSLv3 Kx=DH(512) Au=DSS Enc=DES(40) Mac=SHA1 export EXP-DES-CBC-SHA SSLv3 Kx=RSA(512) Au=RSA Enc=DES(40) Mac=SHA1 export EXP-RC2-CBC-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC2(40) Mac=MD5 export EXP-RC2-CBC-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC2(40) Mac=MD5 export EXP-RC4-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export EXP-RC4-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export Crypto - Michael Soltys August 10, 2015 v1.1 Stream ciphers - 37/45
  • 38. Public Key Crypto Diffie-Hellman ElGamal RSA Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 38/45
  • 39. Diffie-Hellman Key Exchange Oldest public key cryptosystem still in use. Allows two individuals to agree on a shared key, even though they can only exchange messages in public. A weakness is that there is no authentication; the other might be a “bad guy.” Described in RFC 2631 Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 39/45
  • 40. 0 2 4 6 8 10 12 14 16 0 2 4 6 8 10 12 14 16 "primitive.txt" Plot of log3(x) over Z17. Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 40/45
  • 41. Alice Bob 1 Public: p, g such that Zp = g 2 Choose secret a Choose secret b 3 Computer A := ga Compute B := gb 4 Send A to Bob −→ ←− Send B to Alice 5 Compute Ba Compute Ab Alice & Bob have shared value 6 Ab = (ga)b = gab = gba = (gb)a = Ba Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 41/45
  • 42. 1. Alice and Bob agree to use a prime p = 23 and base g = 5. 2. Alice chooses secret a = 8; sends Bob A = ga (mod p) 2.1 A = 58 (mod 23) 2.2 A = 16 3. Bob chooses secret b = 15; sends Alice B = gb (mod p) 3.1 B = 515 (mod 23) 3.2 B = 19 4. Alice computes s = Ba (mod p) 4.1 s = 198 (mod 23) 4.2 s = 9 5. Bob computes s = Ab (mod p) 5.1 s = 1615 (mod 23) 5.2 s = 9 Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 42/45
  • 43. Computing large powers in (Zn, ∗) can be done efficiently with repeated squaring—for example, if (m)b = cr . . . c1c0, then compute a0 = a, a1 = a2 0, a2 = a2 1, . . . , ar = a2 r−1 (mod n), and so am = ac0 0 ac1 1 · · · acr r (mod n). Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 43/45
  • 44. DH only resists passive adversaries. A passive attack is one in which the intruder eavesdrops but does not modify the message stream in any way. An active attack is one in which the intruder may: transmit messages replay old messages modify messages in transit delete selected messages from the wire A typical active attack is one in which an intruder impersonates one end of the conversation, or acts as a man-in-the-middle. This attack motivates the need for authentication. Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 44/45
  • 45. How to do a “man-in-the-middle” on DH? Alice Eve Bob gSA = 8389 gSX = 5876 gSB = 9267 8389 −→ 5876 −→ 5876 ←− 9267 ←− Shared key KAX = 5876SA = 8389SX and shared key KBX = 9267SX = 5876SB Crypto - Michael Soltys August 10, 2015 v1.1 PKC - 45/45