Download presentation
Presentation is loading. Please wait.
Published byCory McKenzie Modified over 9 years ago
2
Cryptography 1 Crypto
3
Cryptography 2 Crypto Cryptology The art and science of making and breaking “secret codes” Cryptography making “secret codes” Cryptanalysis breaking “secret codes” Crypto all of the above (and more)
4
Cryptography 3 How to Speak Crypto A cipher or cryptosystem is used to encrypt the plaintext The result of encryption is ciphertext We decrypt ciphertext to recover plaintext A key is used to configure a cryptosystem A symmetric key cryptosystem uses the same key to encrypt as to decrypt A public key cryptosystem uses a public key to encrypt and a private key to decrypt (sign)
5
Cryptography 4 Crypto Basis assumption o The system is completely known to Trudy o Only the key is secret Also known as Kerckhoffs Principle o Crypto algorithms are not secret Why do we make this assumption? o Experience has shown that secret algorithms are weak when exposed o Secret algorithms never remain secret o Better to find weaknesses before using
6
Cryptography 5 Symmetric Key Notation Encrypt plaintext P with symmetric key K C = E(P,K) Decrypt ciphertext C with symmetric key K P = D(C,K) Encrypt and decrypt are inverses D(E(P,K),K) = E(D(P,K),K) = P Note that same key K is used to encrypt and to decrypt
7
Cryptography 6 Symmetric Key Encryption Must agree on key K in advance How to do this securely? This is a big problem! AliceBob E(Bob’s data, K) E(Alice’s data, K)
8
Cryptography 7 Symmetric Ciphers Popular symmetric key ciphers include o DES o 3DES (aka triple DES) o AES o Blowfish o RC6 o TEA
9
Cryptography 8 Uses for Symmetric Crypto Confidentiality o Transmitting data over insecure channel o Secure storage on insecure media Integrity ( MAC ) Authentication protocols (later…) Anything you can do with a hash function (upcoming chapter…)
10
Cryptography 9 Public Key Cryptography There are 2 keys o Public key used to encrypt o Private key used to decrypt Also have digital signatures o Private key to sign o Public key to verify signature
11
Cryptography 10 Public Key Notation Encrypt message M with Alice’s public key C = {M} Alice Decrypt ciphertext with Alice’s private key M = [C] Alice Private key and public key are inverses {[M] Alice } Alice = [{M} Alice ] Alice = M
12
Cryptography 11 Digital Signature Encrypt message M with Alice’s public key C = {M} Alice To decrypt the ciphertext use private key M = [C] Alice Sign message M with Alice’s private key S = [M] Alice To verify the signature use public key o To verify, show that M = {S} Alice
13
Cryptography 12 Public Key Encryption Bob’s public key is public Alice’s public key is public So no need to agree on key in advance A huge advantage over symmetric key AliceBob {M} Alice {M} Bob
14
Cryptography 13 Digital Signature Bob verifies signature using Alice’s public key (which is public) AliceBob M, [M] Alice
15
Cryptography 14 Public Key Cryptosystems The most popular is RSA o Named after Rivest, Shamir and Adleman RSA can do encryption and signatures A few other public key systems are used o But not many! There are a lots of symmetric ciphers Why so few public key systems?
16
Cryptography 15 Diffie-Hellman A “key exchange” algorithm Only used to establish a shared symmetric key Not for encryption or signing Considered a public key system o Some public info is used to agree on key
17
Cryptography 16 Diffie-Hellman Alice computes (g b ) a = g ab mod p Bob computes (g a ) b = g ab mod p The shared key is g ab mod p Alice secret a Bob secret b g b mod p g a mod p
18
Cryptography 17 Diffie-Hellman Trudy can see g a mod p and g b mod p Trudy wants g ab mod p She can compute o (g a )(g b ) = g a+b g ab mod p If Trudy can find a or b, she wins But finding a from g a mod p is hard o The “discrete log” problem
19
Cryptography 18 Diffie-Hellman Subject to man-in-the-middle (MiM) attack Alice, a Bob, b g a mod p g b mod p Trudy, t g t mod p Trudy shares secret g at mod p with Alice Trudy shares secret g bt mod p with Bob Alice and Bob don’t know Trudy exists!
20
Cryptography 19 Uses for Public Key Crypto Confidentiality o Transmitting data over insecure channel o Secure storage on insecure media Authentication (later) Digital signature provides integrity and non-repudiation o No non-repudiation with symmetric keys
21
Cryptography 20 Symmetric vs Public Key Advantages of symmetric key o Efficiency o No public key infrastructure (PKI) Advantages of public key o No key distribution problem o Digital signatures
22
Cryptography 21 Real World Confidentiality Hybrid cryptosystem: best of both worlds o Public key crypto to establish a key o Symmetric key crypto to encrypt data AliceBob {K} Bob E(Bob’s data, K) E(Alice’s data, K) Can Bob be sure he’s talking to Alice?
23
Cryptography 22 Crypto Hash Function Crypto hash function h(x) provides o Compression output length is small o Efficiency h(x) easy to computer for any x o One-way given a value y it is infeasible to find an x such that h(x) = y o Collision resistance can’t find any x and y, with x y such that h(x) = h(y) o Collisions must exist, but hard to find one
24
Cryptography 23 Popular Crypto Hashes MD5 invented by Rivest o 128 bit output (collision recently found) SHA-1 A US government standard (similar to MD5) o 180 bit output Tiger 192 bit output Many others hashes, but MD5 and SHA-1 most widely used Hashes work by hashing message in blocks
25
Cryptography 24 Hash Uses Authentication ( HMAC ) Message integrity ( HMAC ) Message fingerprint Data corruption detection Digital signature efficiency Anything you can do with symmetric crypto
26
Cryptography 25 Online Auction Suppose Alice, Bob and Charlie are bidders Alice plans to bid A, Bob B and Charlie C They don’t trust that bids will stay secret Solution? o Alice, Bob, Charlie submit hashes h(A), h(B), h(C) o All hashes received and posted online o Then bids A, B and C revealed Hashes don’t reveal bids (one way) Can’t change bid after hash sent (collision)
27
Cryptography 26 Signing and Hashing Suppose Alice signs M o Alice sends M and S = [M] Alice to Bob o Bob verifies that M = {S} Alice If M is big, [M] Alice is costly to compute o Sending M and S also wastes bandwidth Instead, Alice signs h(M) o Alice sends M and S = [h(M)] Alice to Bob o Bob verifies that h(M) = {S} Alice
28
Cryptography 27 Digital Signature Bob verifies signature using Alice’s public key (which is public) AliceBob M, [h(M)] Alice
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.