Computer System- B Security - GitHub Pages
Transcript of Computer System- B Security - GitHub Pages
![Page 1: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/1.jpg)
Computer System- BSecurityIntroduction to Cryptography
Sanjay Rawat
![Page 2: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/2.jpg)
Agenda● A non-technical brief introduction to cryptography● Where/how/why they are used in practice (real examples
to follow)● You will have more rigorous treatment in other units● By custom, we use Alice, Bob and Eve as actors
(parties).
![Page 3: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/3.jpg)
Cryptographic Concepts• Encryption: a means to allow two parties to establish
confidential communication over an insecure channel that is subject to eavesdropping.
3
![Page 4: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/4.jpg)
![Page 5: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/5.jpg)
Encryption and Decryption• The message M is called the plaintext.
• Alice will convert plaintext M to an encrypted form using an encryption algorithm E that outputs a ciphertext C for M.
5
![Page 6: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/6.jpg)
![Page 7: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/7.jpg)
Encryption and Decryption• As equations:
C = E(M)
M = D(C)
• The encryption and decryption algorithms are chosen so that it is infeasible for someone other than Alice and Bob to determine plaintext M from ciphertext C. Thus, ciphertext C can be transmitted over an insecure channel that can be eavesdropped by an adversary.
7
![Page 8: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/8.jpg)
Cryptosystem1. The set of possible plaintexts
2. The set of possible ciphertexts
3. The set of encryption keys
4. The set of decryption keys
5. The correspondence between encryption keys and decryption keys
6. The encryption algorithm to use
7. The decryption algorithm to use
8
![Page 9: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/9.jpg)
Basic Concepts
9
![Page 10: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/10.jpg)
Basic Concepts
10
![Page 11: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/11.jpg)
Basic Concepts
11
![Page 12: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/12.jpg)
Basic Concepts
12
![Page 13: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/13.jpg)
Basic Concepts
13
![Page 14: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/14.jpg)
Basic Concepts
14
![Page 15: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/15.jpg)
Basic Concepts
15
![Page 16: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/16.jpg)
Basic Concepts
16
![Page 17: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/17.jpg)
Basic Concepts
17
![Page 18: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/18.jpg)
Caesar Cipher
• Replace each letter with the one “three over” in the alphabet.
18Public domain image from http://commons.wikimedia.org/wiki/File:Caesar3.svg
![Page 19: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/19.jpg)
Caesar Cipher
• Replace each letter with the one “three over” in the alphabet.
19Public domain image from http://commons.wikimedia.org/wiki/File:Caesar3.svg
![Page 20: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/20.jpg)
Symmetric Cryptosystems
• Alice and Bob share a secret key, which is used for both encryption and decryption.
20
![Page 21: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/21.jpg)
![Page 22: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/22.jpg)
Symmetric Key Distribution
• Requires each pair of communicating parties to share a (separate) secret key.
22
![Page 23: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/23.jpg)
Symmetric Key Distribution
• Requires each pair of communicating parties to share a (separate) secret key.
23
![Page 24: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/24.jpg)
Symmetric Key Distribution
• Requires each pair of communicating parties to share a (separate) secret key.
24
![Page 25: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/25.jpg)
![Page 26: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/26.jpg)
![Page 27: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/27.jpg)
![Page 28: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/28.jpg)
![Page 29: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/29.jpg)
![Page 30: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/30.jpg)
Symmetric Key conti...● Example:
– Advanced Encryption Standard -AES (current standard)● key lengths: 128, 192 and 256 bits
– Data Encryption Standard- DES (triple DES)
● Computationally scalable for large messages● Hardware implementation is available.
– AES-NI (intel)
● Key distribution is a challenge!
![Page 31: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/31.jpg)
Public-Key Cryptography• Bob has two keys: a private key, SB, which Bob keeps
secret, and a public key, PB, which Bob broadcasts widely.
– In order for Alice to send an encrypted message to Bob, she need only obtain his public key, PB, use that to encrypt her message, M, and send the result, C = EPB
(M), to Bob. Bob then uses his secret key to decrypt the message as M = DSB (C).
31
![Page 32: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/32.jpg)
Public-Key Cryptography
• Separate keys are used for encryption and decryption.
32
![Page 33: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/33.jpg)
![Page 34: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/34.jpg)
Public Key Distribution
• Only one key is needed for each recipient
34
![Page 35: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/35.jpg)
![Page 36: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/36.jpg)
Public Key conti..● Examples:
– Rivest Shamir Adleman (RSA)● Recommended key size: 1,024 to 4,096 bit typical
– ElGamal encryption
● Computationally very expensive– Handling large message is ineffecient–
![Page 37: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/37.jpg)
Message AuthenticationSo far, we covered secrecy of the message i.e.
confidentiality. message authentication is concerned with:
- protecting the integrity of a message - validating identity of originator - non-repudiation of origin (dispute resolution)
Three alternative functions used:- message encryption- message authentication code (MAC)- hash function
37
![Page 38: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/38.jpg)
Message AuthenticationMessage authentication is a mechanism or
service used to verify the integrity of a message.Message authentication assures that data
received are exactly as sent by (i.e., contain no modification, insertion, deletion, or replay) and
that the purported identity of the sender is valid.
38
![Page 39: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/39.jpg)
Authentication FunctionsMessage encryption: The ciphertext of the entire message
serves as its authenticatorMessage authentication code (MAC): A function of the
message and a secret key that produces a fixed-length value that serves as the authenticator
Hash function: A function that maps a message of any length into a fixed-length hash value, which serves as the authenticator
39
![Page 40: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/40.jpg)
Digital Signatures
• Public-key encryption provides a method for doing digital signatures
• To sign a message, M, Alice just encrypts it with her private key, SA, creating C = ESA(M).
• Anyone can decrypt this message using Alice’s public key, as M’ = DPA(C), and compare that to the message
M. 40
![Page 41: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/41.jpg)
Message Authentication Code (MAC)● Allows for Alice and Bob to have data integrity, if they share a secret key.● Generated by an algorithm that creates a small fixed-sized block depending on
both message M and some secret key K s.t. MAC = C(K,M), where● M = input message● C = MAC function● K = shared secret key● MAC = message authentication code
● Appended to message as a signature● Receiver performs same computation on message and checks it matches the MAC● Provides assurance that message is unaltered and comes from sender
41
![Page 42: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/42.jpg)
MAC conti…
42
![Page 43: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/43.jpg)
Cryptographic Hash Functions
• A checksum on a message, M, that is:
• One-way: it should be easy to compute Y=H(M), but hard to find M given only Y
• Collision-resistant: it should be hard to find two messages, M and N, such that H(M)=H(N).
• Examples: SHA-1, SHA-256.
43
![Page 44: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/44.jpg)
Application of Hash
44
![Page 45: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/45.jpg)
Digital Certificates
• certificate authority (CA) digitally signs a binding between an identity and the public key for that identity.
47
![Page 46: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/46.jpg)
Public Distribution of Secret Keys
• Public-key algorithms are slow• So we usually want to use symmetric key
encryption to protect message contents• Hence need to share secret (session) key • There are alternatives for negotiating a
suitable session
48
![Page 47: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/47.jpg)
Diffie-Hellman Key Exchange
● First public-key type scheme proposed by Diffie & Hellman in 1976 along with the exposition of public key concepts1
● Practical method for public exchange of a secret key● Used in a number of real-world commercial
products/protocols
49
1. Now know that Williamson (UK CESG) secretly proposed the concept in 1970
![Page 48: Computer System- B Security - GitHub Pages](https://reader031.fdocuments.net/reader031/viewer/2022012100/6169dcb111a7b741a34c311e/html5/thumbnails/48.jpg)
Diffie-Hellman Key Exchange● a public-key distribution scheme
- cannot be used to exchange an arbitrary message - rather it can establish a common key - known only to the two participants
● value of key depends on the participants (and their private and public key information)
● security relies on the difficulty of computing discrete logarithms (similar to factoring) – hard
50