• No results found

Introduction Number Theory in Cryptography

N/A
N/A
Protected

Academic year: 2021

Share "Introduction Number Theory in Cryptography"

Copied!
53
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Number Theory in Cryptography

Introduction

September 20, 2006 Universidad de los Andes

(2)
(3)

Guessing Numbers

(4)

Guessing Numbers

(person x) 7−→ (last 6 digits of phone number of x)

A Hash Function is a function f from A to B such that • It is easy to compute f(x) for any x ∈ A.

• For any y ∈ B, it is hard to find an x ∈ A with f(x) = y. • It is hard to find x, x0 ∈ A with x 6= x0 and f(x) = f (x0).

(5)

Caesar Cipher

(6)

Caesar Cipher

VIXYVR XS VSQI

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z W X Y Z A B C D E F G H I J K L M N O P Q R S T U V

(7)

Caesar Cipher

VIXYVR XS VSQI

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z W X Y Z A B C D E F G H I J K L M N O P Q R S T U V

(8)

Caesar Cipher

VIXYVR XS VSQI

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z W X Y Z A B C D E F G H I J K L M N O P Q R S T U V

RETURN TO ROME

(9)

Substitution Cipher

MQWE WE B YXM QBLHGL

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Q A Z X S W E D C V F R T G B N H Y U J M K I O L P

(10)

Substitution Cipher

MQWE WE B YXM QBLHGL

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Q A Z X S W E D C V F R T G B N H Y U J M K I O L P

(11)

Substitution Cipher

MQWE WE B YXM QBLHGL

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Q A Z X S W E D C V F R T G B N H Y U J M K I O L P

THIS IS A LOT HARDER Breaking the code:

(12)

Solution:

Letter Frequencies

English Spanish A 82 125 B 14 14 C 28 47 D 38 59 E 131 137 F 29 7 G 20 10 H 53 7 I 63 62 J 1 4 K 4 0 English Spanish N 71 67 O 80 86 P 20 25 Q 1 9 R 68 69 S 61 79 T 105 46 U 25 39 V 9 9 W 15 0 X 2 2

(13)

Viginere Cipher

(14)

Viginere Cipher

HVD PZAHSQ JMLEIDRXPSG ZVZ UCH OVZZSFUIY

Shift the letters of the encrypted message according to the value of the letters of the secret keyword “LLAVES.” (a= 1, b= 2, . . .).

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

H V D P Z A H S Q J M L E I D R X P S G Z V Z U C H O V Z Z S F U I Y L L A V E S L L A V E S L L A V E S L L A V E S L L A V E S L L A V E T H E L E T T E R F R E Q U E N C I E S A R E N O T P R E S E R V E D

(15)

Viginere Cipher

HVD PZAHSQ JMLEIDRXPSG ZVZ UCH OVZZSFUIY

Shift the letters of the encrypted message according to the value of the letters of the secret keyword “LLAVES.” (a= 1, b= 2, . . .).

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 H V D P Z A H S Q J M L E I D R X P S G ZV Z U C H OV ZZ S F U I Y L L A V E S L L A V E S L L A V E S L L AV E S L L A V ES L L A V E T H E L E T T E R F R EQ U E N C I E S AR E N O T P R ES E R V E D E N E S E N E S

Repeated bigrams stay repeated bigrams

(16)

Security

All these ciphers are breakable

once the enemy knows

(17)

Enigma

(18)

F E D C B A REFLECTOR 1 2 3 ROTORS Period of 263 substitutions

(19)

F E D C B A REFLECTOR 1 2 3 ROTORS Period of 263 substitutions Weaknesses:

Permutations are involutions Letter x does not map to x Rotors can be stolen

(20)

F E D C B A REFLECTOR 1 2 3 ROTORS Period of 263 substitutions Weaknesses:

Permutations are involutions Letter x does not map to x Rotors can be stolen

Book of initial settings too User errors:

repeated initial 3 letters nonrandom initial 3 letters test message with only T ’s

(21)

F E D C B A REFLECTOR 1 2 3 ROTORS Period of 263 substitutions Weaknesses:

Permutations are involutions Letter x does not map to x Rotors can be stolen

Book of initial settings too User errors:

repeated initial 3 letters nonrandom initial 3 letters test message with only T ’s British could decipher until 1932, then extra keyboard permutation.

(22)

F E D C B A REFLECTOR 1 2 3 ROTORS Period of 263 substitutions Weaknesses:

Permutations are involutions Letter x does not map to x Rotors can be stolen

Book of initial settings too User errors:

repeated initial 3 letters nonrandom initial 3 letters test message with only T ’s British could decipher until 1932, then extra keyboard permutation. Polish until 1939, then extra rotors, no repeated 3 letters.

(23)

F E D C B A REFLECTOR 1 2 3 ROTORS Period of 263 substitutions Weaknesses:

Permutations are involutions Letter x does not map to x Rotors can be stolen

Book of initial settings too User errors:

repeated initial 3 letters nonrandom initial 3 letters test message with only T ’s British could decipher until 1932, then extra keyboard permutation. Polish until 1939, then extra rotors, no repeated 3 letters.

At the end of the war all messages could be deciphered in 2 days. The Germans were still confident about ENIGMA.

(24)

Lesson learned

A crypto system should be safe even if

• the enemy knows your encryption algorithm

• the enemy knows lots of plain texts together with their encryptions (no chosen plain text attacks)

(25)

Lesson learned

A crypto system should be safe even if

• the enemy knows your encryption algorithm

• the enemy knows lots of plain texts together with their encryptions (no chosen plain text attacks)

Solution

(26)

Data Encryption Standard (DES, 1974)

Xor: ⊕ 0 1 0 0 1 1 1 0 (x ⊕ y) ⊕ y = x

(27)

Data Encryption Standard (DES, 1974)

Xor: ⊕ 0 1 0 0 1 1 1 0 (x ⊕ y) ⊕ y = x message 1 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 key 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 ⊕ encryption 1 1 0 0 1 1 0 0 0 1 0 1 1 0 1 1

(28)

Data Encryption Standard (DES, 1974)

Xor: ⊕ 0 1 0 0 1 1 1 0 (x ⊕ y) ⊕ y = x message 1 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 key 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 ⊕ encryption 1 1 0 0 1 1 0 0 0 1 0 1 1 0 1 1 encryption ⊕ key = message

(29)

Data Encryption Standard (DES, 1974)

Xor: ⊕ 0 1 0 0 1 1 1 0 (x ⊕ y) ⊕ y = x message 1 0 1 0 0 1 0 1 0 1 0 0 1 0 0 1 key 0 1 1 0 1 0 0 1 0 0 0 1 0 0 1 0 ⊕ encryption 1 1 0 0 1 1 0 0 0 1 0 1 1 0 1 1 encryption ⊕ key = message

(30)

Data Encryption Standard (DES, 1974)

• Pick a secret shared key of 64 bits.

• Divide the message in blocks of 64 bits.

• Encrypting one block consists of a combination of repeated ⊕ with parts of the key, permutations,

(31)

Data Encryption Standard (DES, 1974)

• Pick a secret shared key of 64 bits.

• Divide the message in blocks of 64 bits.

• Encrypting one block consists of a combination of repeated ⊕ with parts of the key, permutations,

breaking up in subblocks, and small functions by table.

Disadvantage: Need to agree on a key before hand... System uses a secret shared key

(32)

Data Encryption Standard (DES, 1974)

• Pick a secret shared key of 64 bits.

• Divide the message in blocks of 64 bits.

• Encrypting one block consists of a combination of repeated ⊕ with parts of the key, permutations,

breaking up in subblocks, and small functions by table.

Disadvantage: Need to agree on a key before hand... System uses a secret shared key

(33)

Public Keys

English Lonapse many English Lonapse unique English Lonapse

(34)

Public Keys

English Lonapse public key English Lonapse private key English Lonapse

(35)

Public Keys

ME ML ME ML encrypting, sending, and decrypting a message E2L L2E

B

A

(36)

Public Keys

ME ML ME ML encrypting, sending, and decrypting E2L L2E

B

A

(37)

Public Keys

ME ML ME ML encrypting, sending, and decrypting a message E2L L2E

English and Lonapse have same words!

B

A

?ME? MN L

ME MN L

signing, sending,

and checking the signature

of a message

E2L

(38)

Public Keys (RSA)

RSA (Rivest, Shamir, Adleman):

An n >> 0, a public key e, and a private key d, such that xde ≡ x mod n for all x.

(39)

Public Keys (RSA)

0 < M < n xde ≡ x mod n M Me M ≡ (Me)d Me encrypting, sending, and decrypting a message M

B

A

M ≡ (M? d)e Md M Md signing, sending,

and checking the signature

(40)

Public Keys (RSA)

Security of this system is based on our inability to take e-th roots. A factorization of n allows one to compute d from e.

It is believed that finding d is as hard as factorizing n.

(41)

Public Keys (RSA)

Security of this system is based on our inability to take e-th roots. A factorization of n allows one to compute d from e.

It is believed that finding d is as hard as factorizing n.

So breaking this system would be as hard as factorizing n.

Advantages:

compact, use in smart cards both encryption and signing

(42)

Public Keys (RSA)

Security of this system is based on our inability to take e-th roots. A factorization of n allows one to compute d from e.

It is believed that finding d is as hard as factorizing n.

So breaking this system would be as hard as factorizing n.

Advantages:

compact, use in smart cards both encryption and signing

Disadvantages:

Computationally intensive only small messages

man-in-the-middle attack (weakness of public keys)

(43)

RSA only encripts small messages

For signing, you can just sign a hash-function of the message instead.

B

A

H(M ) ≡ (H(M )? d)e [M, H(M )d]

M [M, H(M )d]

signing, sending,

and checking the signature

(44)

RSA only encripts small messages

For encryption, one can use public-key systems to agree on a shared secret key for a more efficient encryption

algorithm (like triple-DES).

(45)

Public key systems and the man-in-the-middle attack

(46)

Public key systems and the man-in-the-middle attack

(47)

Public key systems and the man-in-the-middle attack

(48)

Public key systems and the man-in-the-middle attack

(49)

Public key systems and the man-in-the-middle attack

(50)

Public key systems and the man-in-the-middle attack

B

M

A

Solution: A trusted third party

(online companies that garantee you are you by checking your credit card info)

(51)

Important

(52)

Important

• Factorizing integers

(53)

Important

• Factorizing integers

• Discrete logarithms (tomorrow)

Referenties

GERELATEERDE DOCUMENTEN

4 | 05-07-2016 Research Framework Processing fluency Debtor response Readability demand letter + + H1: + Debtor characteristics Age Social class Amount of debt Gender

loos on lipb or;ogings dilmols by kinders opgomork word. die woordo on letters moot nio not retinaal nio 7 maar ook kortikaal waargonoom vrord. Dio goskrouo taal

Voor de bovengenoemde schatter zijn de volgende gegevens noodzakelijk te weten: door wie, worden welke risicogeneesmiddelen met welke dosering gebruikt en op

AIle benodigde gegevens voor de datataker zijn nu bepaald, proef kan met optie 5 van het hoofdmenu worden gestart.. Deze checklist is

sequences distance matrix pairwise alignment sequence-group alignment group-group alignment guide tree. final

Even so, however, # 6 (published in 1971) referred to the deceased person as being the addressee' husband (who may have been the brother of the writer of the letter.) We cannot even

Although no data are available, we assume that selective prescribing has also taken place because of previous angioedema during the use of ACEIs and that the number of reports

Secondly, Jewish anxiety about the film was based on an assessment of the film as, politically, at the polar opposite of the Left Behind series with its implicit pro-Zionism,