55
Cryptography and The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London

Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Cryptography and The Da Vinci Code

Prof. Keith Martin

Information Security Group

Royal Holloway

University of London

Page 2: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

(OR… what Sophie Neveu did NOT seem to learn

when she studied at Royal Holloway)

Page 3: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

3

"There's an easier way," Sophie said, taking the pen from Teabing. "It works for all reflectional substitution ciphers, including the Atbash. A little trick I learned at the Royal Holloway." Sophie wrote the first half of the alphabet from left to right and then, beneath it, wrote the second half, right to left. "Cryptanalysts call it the fold-over. Half as complicated. Twice as clean." Teabing eyed her handiwork and chuckled.: "Right you are. Glad to see those boys at the Holloway are doing their job."

Page 4: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

What is cryptography ?

Page 5: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Have you used cryptography:

on a daily basis?

on a weekly basis?

occasionally?

Page 6: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

6

A simple scenario

Alice Bob

Page 7: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

7

Risks to information

• Passive attacks

– unauthorised access to information

• Active attacks

– Unauthorised alteration

– Unauthorised deletion

– Unauthorised transmission

– Falsification of origin of information

– Unauthorised prevention of access to

information

Page 8: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

8

Cryptography: the toolkit

Cryptography provides a mathematical

toolkit of techniques that can be called

upon in order to implement the security

services required for any application.

Page 9: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

9

Cryptographic primitives

Page 10: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

The need for confidentiality

Page 11: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Sending a letter to a friend

Page 12: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Sending an email to a friend

Page 13: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Calling a friend on a mobile

Page 14: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

The Caesar Cipher

Page 15: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

15

The Caesar Cipher

ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ

ABCDEFGHIJKLMNOPQRSTUVWXYZ

sliding ruler

Page 16: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

Page 17: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C

Key shift C

Page 18: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C D E F G H I J K L ... Z A B

Key shift C

Page 19: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C D E F G H I J K L ... Z A B

Key shift C

A C E A X E

Page 20: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C D E F G H I J K L ... Z A B

Key shift C

A C E

C

A X E

Page 21: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C D E F G H I J K L ... Z A B

Key shift C

A C E

C E

A X E

Page 22: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C D E F G H I J K L ... Z A B

Key shift C

A C E

C E G

A X E

Page 23: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C D E F G H I J K L ... Z A B

Key shift C

A C E

C E G

A X E

C

Page 24: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C D E F G H I J K L ... Z A B

Key shift C

A C E

C E G

A X E

C Z

Page 25: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Example

A B C D E F G H I J ... X Y Z

C D E F G H I J K L ... Z A B

Key shift C

A C E

C E G

A X E

C Z G

Page 26: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Caesar Cipher Challenges

What creature hops about and explodes near a naked flame?

MX MW E KEWLSTTIV (key shift E) Which creature says “baa” and fights at sea? ZNOY OY G HGZZRKYNKKV (key shift G) Which animal runs very fast and keeps you warm?

AL AK S OAFVUZWWLSZ (key shift S)

Page 27: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

27

Simple Substitution Cipher

a b c d e f g h i j k l m

D I Q M T B Z S Y K V O F

n o p q r s t u v w x y z

E R J A U W P X H L C N G

Page 28: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

28

Keyspace of the Substitution Cipher

The key space of the Simple Substitution Cipher is

approximately 4 x 1026, that is:

400 000 000 000 000 000 000 000 000

Just how big is that?

There are an estimated 10 sextillion (that’s 1022) stars in our

universe. That means that the Simple Substitution Cipher has

about 40 000 times the number of keys than there are stars in

our universe.

The key space of DES is somewhere between 1016 and 1017.

That’s a much smaller number – it’s only about 100 000 times

the number of stars in our galaxy!

Page 29: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

29

Substitution Cipher Examples

Decrypt the following ciphertexts

1 B TO T OTA

2 XAV

3 VBDDQD

4 VBDDQD (given that the plaintext is the

name of a country)

5 ABXAZ O OAZ TCYE TE F CEOE UCZXT

Page 30: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

30

World Cup 2010 Special Examples

OQC UQFKFOX

HPSNRPV

TBZ

GYZICEBCG

YEVENLEM

Page 31: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

31

Substitution Cipher Histogram

0

5

10

15

20

25

30

35

A C E G I K M O Q S U W Y

Num

ber

of O

ccurr

ences

A histogram showing the relative frequencies of the letters in a

cryptogram that was obtained by using a simple substitution cipher.

Page 32: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

32

Advanced Encryption Standard

Byte

substitution

Shift rows

Mix

columns

AES

S-box

Key

schedule

round key + +

key

current state

new state

Page 33: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

33

A cryptosystem

ciphertext Encryption

algorithm Decryption

algorithm

encryption key decryption key

plaintext plaintext

Interceptor

Sender Receiver

Page 34: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

The need for data integrity

Page 35: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Two things that can go wrong...

Accidental errors Deliberate errors

Page 36: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

How the Internet works (part 1)

Page 37: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

How the Internet works (part 2)

Page 38: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to
Page 39: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Morse Code Example

0010 01 1000 00 111

Page 40: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

The ISBN number

Page 41: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Deliberate errors

Page 42: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

42

CBC-MAC

M1

E K E K E K

E K

MAC

M2 M3 Mn

(Padded) message divided into blocks

C1 C2

1 2 3

M1 M2 M3 .., Mn

MAC 4

Page 43: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

The need for authentication

Page 44: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

A problem with email

Can you be sure that an email from a friend is really from your friend?

Page 45: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

A need for authentication!

Page 46: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

46

Types of entity authentication

The most common methods use (a combination of):

• something that you have

• something that you are

• something that you know

Page 47: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Passwords

Choose a password....

PASSWORD1

ABCDEFG

WILLIAMKATE

STATION778

MARSBAR

CV8**G9Pa2

Page 48: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

48

One-time password mechanisms

Key

Random

Number

Generator

challenge PIN

A

response

Decision

= ?

A A Key

challenge

Device Smart Token User

1

2

4

5

6

7

3

Page 49: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Real world applications need

Confidentiality Data Integrity Authentication ...to varying degrees

Page 50: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

So... what did Sophie Neveu learn at Royal Holloway ?

Page 51: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

51

Atbash Cipher

a b c d e f g h i j k l m

Z Y X W V U T S R Q P O N

n o p q r s t u v w x y z

M L K J I H G F E D C B A

Page 52: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

52

"There's an easier way," Sophie said, taking the pen from Teabing. "It works for all reflectional substitution ciphers, including the Atbash. A little trick I learned at the Royal Holloway." Sophie wrote the first half of the alphabet from left to right and then, beneath it, wrote the second half, right to left. "Cryptanalysts call it the fold-over. Half as complicated. Twice as clean." Teabing eyed her handiwork and chuckled.: "Right you are. Glad to see those boys at the Holloway are doing their job."

Page 53: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

53

Highly recommended

http://www.cryptool.org/

Page 54: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

54

Some bed-time reading • F. Piper and S. Murphy, Cryptography: A Very Short

Introduction, Oxford University Press (2002).

• H.X. Mel and D. Baker, Cryptography Decrypted, Addison-Wesley (2001).

• D.R. Stinson, Cryptography: Theory and Practice, 3rd Edition, Chapman & Hall/CRC Press (2006).

• S. Levy, Crypto, Penguin Books (2000).

• S. Singh, The Code Book, Fourth Estate (1999).

• N. Ferguson and B. Schneier Practical Cryptography, Wiley (2003).

Page 55: Cryptography and The Da Vinci Code · The Da Vinci Code Prof. Keith Martin Information Security Group Royal Holloway University of London (OR… what Sophie Neveu did NOT seem to

Thank You