Top Banner
1 Cryptography NOTES
24

1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

Jan 16, 2016

Download

Documents

Myles Paul
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

1

Cryptography

NOTES

Page 2: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

2

Secret Key Cryptography

• Single key used to encrypt and decrypt.

• Key must be known by both parties.

• Assuming we live in a hostile environment (otherwise - why the need for cryptography?), it may be hard to share a secret key.

Page 3: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

3

Public Key Cryptography(a.k.a. asymmetric cryptography)

• Relatively new field - 1975 (as far as we know, the NSA is not talking).

• Each entity has 2 keys:– private key (a secret)– public key (well known).

Page 4: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

4

• Private keys are used for decrypting.

• Public keys are used for encrypting.

encryptionplaintext ciphertext

public key

decryptionciphertext plaintext

private key

Using Keys

Page 5: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

5

Digital Signature• Public key cryptography is also used to

provide digital signatures.

signingplaintext signed message

private key

verificationsigned message plaintext

public key

Page 6: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

6

Transmitting over an insecure channel.

Alice wants to send Bob a private message.

Apublic is Alice’s public key.

Aprivate is Alice’s private key.

Bpublic is Bob’s public key.

Bprivate is Bob’s private key.

Page 7: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

7

Hello Bob,Wanna get together?

AliceAlice BobBob

encrypt using Bpublic decrypt using Bprivate

Page 8: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

8

OK Alice,Your place or mine?

AliceAlice BobBob

decrypt using Aprivate encrypt using Apublic

Page 9: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

9

Bob’s Dilemma

• Nobody can read the message from Alice, but anyone could produce it.

• How does Bob know that the message was really sent from Alice?

• Bob may be comforted to know that only Alice can read his reply.

Page 10: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

10

Alice can sign her message!

• Alice can create a digital signature and prove she sent the message (or someone with knowledge of her private key).

• The signature can be a message digest encrypted with Aprivate.

Page 11: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

11

Message Digest

• Also known as “hash function” or “one-way transformation”.

• Transforms a message of any length and computes a fixed length string.

• We want it to be hard to guess what the message was given only the digest.– Guessing is always possible.

Page 12: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

12

Alice’s Signature

• Alice feeds her original message through a hash function and encrypts the message digest with Aprivate.

• Bob can decrypt the message digest using Apublic.

• Bob can compute the message digest himself.

• If the 2 message digests are identical, Bob knows Alice sent the message.

Page 13: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

13

AliceAlice BobBob

Sign with Aprivate check signature using Apublic

encrypt using Bpublic decrypt using Bprivate

Revised Scheme

Page 14: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

14

Why the digest?

• Alice could just encrypt her name, and then Bob could decrypt it with Apublic.

• Why wouldn’t this be sufficient?

Page 15: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

15

Implications

• Suppose Alice denies she sent the message?

• Bob can prove that only someone with Alice’s key could have produced the message.

Page 16: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

16

Another possible problem• Suppose Bill receives a message from Alice

including a digital signature.

“meet me at the library tonight”

• Bill sends the same message to Joe so that it looks like the message came from Alice.

• Bill includes the digital signature from the message Alice sent to him.

• Joe is convinced Alice sent the message!

Page 17: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

17

Solution?

• Always start your messages with:– Dear Bill,

• Create a digest from the encrypted message and sign that digest.

• There are many other schemes as well.

Page 18: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

18

Speed

• Secret key encryption/decryption algorithms are much faster than public key algorithms.

• Many times a combination is used:– use public key cryptography to share a

secret key.– use the secret key to encrypt the bulk of

the communication.

Page 19: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

19

Secure Protocols

• There are a growing number of applications for secure protocols:– email– electronic commerce– electronic voting– homework submission

Page 20: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

20

Secure Protocols

• Many application protocols include the use of cryptography as part of the application level protocol.– The cryptographic scheme employed is

part of the protocol.– If stronger cryptographic tools become

available we need to change the protocol.

Page 21: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

21

SSL and TLS

• Secure Sockets Layer (SSL) is a different approach - a new layer is added that provides a secure channel over a TCP only link.

• TLS is Transport Layer Security (IETF standard based on SSL).

Page 22: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

22

SSL layer

Application

SSL

TCP

IP

Application

SSL

TCP

IP

Page 23: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

23

Advantages of SSL/TLS

• Independent of application layer

• Includes support for negotiated encryption techniques.– easy to add new techniques.

• Possible to switch encryption algorithms in the middle of a session.

Page 24: 1 Cryptography NOTES. 2 Secret Key Cryptography Single key used to encrypt and decrypt. Key must be known by both parties. Assuming we live in a hostile.

24

HTTPS Usage

• HTTPS is HTTP running over SSL.– used for most secure web transactions.– HTTPS server usually runs on port 443.– Include notion of verification of server via a

certificate.– Central trusted source of certificates.