cryptography - fcampenafrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing...

46
1 Communicating Secur ely CRYPTOGRAPHY

Upload: phamdiep

Post on 07-May-2018

226 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

1

Communicating Securely

CRYPTOGRAPHY

Page 2: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

2

THE PROBLEM

Encrypt and send the following message to another person utilizing a basic implementation of the RSA cryptosystem:

“This is a secret message.”

Demonstrate how the receiver can decrypt and understand this message.

Page 3: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

3

Keep it Secret!

Page 4: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

4

Communicating Securely

Page 5: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

5

Goal of a Cryptosystem

Relay an information from one place to another without anyone else being able to read it.

Page 6: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

6

Encryption and Decryption

● Encryption is the process of using an algorithm to transform information into a format that cannot be read.

● Decryption is the process of using another algorithm to transform encrypted information back into a readable format.

● The original information is referred to as the plain text while the encrypted version is the cipher text.

Page 7: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

7

A Cypher System

Page 8: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

8

Encryption and Decryption

● Encryption and decryption are processes performed in cryptography, which is essentially about inventing cryptosystems (also called cryptographic systems or cipher systems).

● Breaking cryptoystems, on the other hand, is part of cryptanalysis.

● Cryptography and cryptanalysis make up what we refer to as cryptology.

Page 9: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

9

Cryptology

Cryptography Cryptanalysis

Encryption Decryption

Page 10: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

10

Objectives of Encryption

1. Confidentiality. The sender (let us call her Alice) and receiver (let us call him Bob) can be assured that no third party can read the message.

2. Integrity. Alice and Bob can be sure that no third party can make changes in the message.

3. Authenticity. Bob can be sure that Alice sent the message.

4. Non-repudiation. Bob can prove to any third party that Alice sent the message.

Page 11: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

11

Some Encryption SystemsPIGPEN

Page 12: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

12

Some Encryption SystemsPIGPEN

Encrypt the message using the Pigpen Cipher:

KEEPMEUNKNOWN

Page 13: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

13

Some Encryption SystemsCAESAR'S CIPHER

Encipher the message “THIS IS A SECRET MESSAGE“

using the following key:

Page 14: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

14

Some Encryption SystemsVIGENERE CIPHER● This type of cipher is said to polyalphabetic as

opposed to a monoalphabetic (where the same cipher letter is used for each occurrence of a given letter in the plain text).

Page 15: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

15

Some Encryption SystemsVIGENERE CIPHER

● Suppose the message to be sent is “Run now!”

● Using the alphabet A B … Z → 0 1 … 25 and keyword “hush”, we proceed as follows:

Page 16: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

16

Some Encryption SystemsVIGENERE CIPHER

To decrypt, we reverse the process (do subtractions instead).

Page 17: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

17

Some Encryption SystemsVIGENERE CIPHER

● Do item #24a and #25a on page 120.

● Which is more difficult to decrypt? A monoalphabetic cryptosystem or a polyalphabetic cryptosystem?

Page 18: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

18

Symmetric and Asymmetric Cryptography

There are two basic techniques for encrypting information:

● symmetric encryption (also called secret key encryption) and

● asymmetric encryption (also called public key encryption.)

Page 19: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

19

Symmetric Cryptography

Page 20: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

20

Asymmetric Cryptography

Page 21: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

21

Public Key Encryption

● In 1976, W. Diffie and M. Hellman introduced a new method of encryption and key management now referred to as public key cryptography.

● Public key cryptography is a system that uses a pair of keys (a public key and a private key).

Page 22: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

22

Public Key Encryption

● Each individual is assigned these keys to encrypt and decrypt information.

● A message encrypted by one of the two keys (the public key) can only be decrypted by the other key in the pair (the private key).

● This method is also referred to as asymmetric cryptography.

Page 23: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

23

Public Key Encryption

Page 24: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

24

Public Key Encryption

● The public key is available for others to use when encrypting information that will be sent to an individual.

● Similarly, people can use that individual's public key to decrypt information sent by him.

● The private key, on the other hand, is accessible only to the individual.

Page 25: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

25

Public Key Encryption

● The individual can use his private key to decrypt any message encrypted with his public key.

● Or he can use his private key to encrypt messages, so that the messages can only be decrypted with his corresponding public key.

Page 26: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

26

Modular Arithmetic

The mathematical statement

a ≡ b (mod n)

means that the difference a – b is divisible by the integer n.

For example,

(a) 8 ≡ 2 (mod 3) since the number 8 – 2 = 6 is divisible by 3.

(b) 0 ≡ 24 (mod 6) since 0 – 24 = – 24 is divisible by 6.

Page 27: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

27

Modular Arithmetic

When you are given the problem

b ≡ x (mod n)

which means that n divides b – x then there must be an integer t such that b – x = nt or

b = x + nt.

This equation tells us that when b is greater than or equal to n, the number x can be interpreted as the remainder when b is divided by n

Page 28: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

28

Modular Arithmetic

Equivalence Properties

● a ≡ a (mod n)

● a ≡ b (mod n) implies b ≡ a (mod n)

● a ≡ b (mod n) and b ≡ c (mod n) implies a ≡ c (mod n)

Page 29: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

29

RSA Cryptosystem

Rivest, Shamir, and Adleman

Page 30: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

30

RSA Cryptosystem

● RSA (for Rivest, Shamir, and Adleman) is based on the assumption that factoring large integers is computationally hard.

● RSA implemented two important ideas: public key encryption and digital signatures. This is not only useful for electronic mail, but for other electronic transactions and transmissions, such as fund transfers.

Page 31: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

31

RSA Cryptosystem

● It was the RSA cryptosystem that first convinced the mathematical community that public key cryptographic systems might be feasible.

● The security of the RSA algorithm has so far been validated, since no known attempts to break it have yet been successful.

Page 32: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

32

RSA Key Generation

1) Take two large primes p and q and compute n = pq.

2) Choose a number e less than n and relatively prime to

(p – 1)(q – 1).

3) Find another number d such that ed – 1 is divisible by

(p – 1)(q – 1). A formula for d is

4) The public key is (n, e) and the private key is (n, d).

d=1+k ( p−1)(q−1)

e, for some integer e

Page 33: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

33

Illustration

● a) Let p = 43 and q = 59. Then n = pq = 2537.

● b) Choose e = 13 . This number is both less than 2537 and relatively prime to (p – 1)(q – 1) = 42(58) = 2456.

● c) If k = 5, then

.

● d) Hence, the public key is (2537, 13) and the private key is (2537, 937) .

d=1+k (p−1)(q−1)

e=

1+5(2436)13

=937

Page 34: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

34

RSA Encryption

1) Translate the message into a sequence of integers.

2) Group integers together to form large integers, each representing a block of letters.

3) Transform the message M to the encrypted version C using

C=M e(mod n)

Page 35: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

35

RSA Decryption

● To retrieve the original message M, decrypt the message C using

M=Cd(mod n)

Page 36: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

36

Illustration (Encryption)

● Goal: Send the message “STOP.“

● Step 1: Translate this message into a sequence of integers

ABCDEFGHIJKLMNOPQRSTUVWXYZ → 00 01 02 … 25.

● Step 2: We group integers together to form even larger integers, each representing a block of letters.

STOP → 18 19 14 15 → 1819 1415

Page 37: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

37

Illustration

● Step 3: Encrypt 1819 and 1415 as follows:

1819 → 181913 (mod 2537) ≡ 2081

1415 → 141513 (mod 2537) ≡ 2182

Therefore, the message STOP is equivalent to the ciphertext 2081 2182.

Page 38: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

38

Illustration (Decryption)

● Goal: Decrypt “ 2081 2182“ will perform the following decryption:

2081 → 2081937 (mod 2537) ≡ 1819

2182 → 2182937 (mod 2537) ≡ 1415

The receiver will conclude that 2081 2182 is 1819 1415 or ST OP or STOP.

Page 39: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

39

FIRMING UP

Do each of the following items:

● Item #1, 3 on page 117

● Item #4, 6 on page 118

● Item #24, 26 on page 120

● Item #31-32, page 121

Page 40: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

40

DEEPENING

Do each of the following items:

● Any two items from item #11 to #14 on page 118

● Item #29 on page 121

● Item #42 and 46 on page 122

Page 41: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

41

EXPLORING

● Encrypt “This is another secret message.” using the Autokey Cipher (see page 120).

● Do any three of item #s 39, 40, 43, 44, 48, and 49 on page 122.

Page 42: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

42

Reading Assignment

● Read the lesson on Authentication and Steganography

● Do each of the following:

1) Explain the meaning and importance of authentication in cryptography.

2) What are the different possible ways of authentication?

3) Explain the meaning of steganography.

4) Why do you think this method of secret handling is developed?

Page 43: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

43

BLOG YOUR THOUGHTS

● Communicating securely means ______________________

● Encryption is different from decryption since _____________

● Asymmetric cryptography is different from symmetric cryptography since _____________________

● The concepts of cryptography are important since __________________.

● For me, the mathematics behind the study of cryptography is _________________.

● I find this topic ___________________.

Page 44: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

44

Page 45: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

45

Page 46: CRYPTOGRAPHY - FCAMPENAfrancisjosephcampena.weebly.com/.../cryptographyslidenocone.pdf · utilizing a basic implementation of the RSA cryptosystem: ... Cryptography and cryptanalysis

46