Discrete Mathematics with Applications MATH236 Dr. Hung P. - - PowerPoint PPT Presentation

discrete mathematics with applications math236
SMART_READER_LITE
LIVE PREVIEW

Discrete Mathematics with Applications MATH236 Dr. Hung P. - - PowerPoint PPT Presentation

Discrete Mathematics with Applications MATH236 Dr. Hung P. Tong-Viet School of Mathematics, Statistics and Computer Science University of KwaZulu-Natal Pietermaritzburg Campus Semester 1, 2013 Tong-Viet (UKZN) MATH236 Semester 1, 2013 1 /


slide-1
SLIDE 1

Discrete Mathematics with Applications MATH236

  • Dr. Hung P. Tong-Viet

School of Mathematics, Statistics and Computer Science University of KwaZulu-Natal Pietermaritzburg Campus

Semester 1, 2013

Tong-Viet (UKZN) MATH236 Semester 1, 2013 1 / 23

slide-2
SLIDE 2

Table of contents

1

Finding generators in Z∗

p 2

Review of Chapter 3

3

Chapter 4. Fundamentals of cryptopology Introduction Monoalphabetic and Polyalphabetic ciphers

Tong-Viet (UKZN) MATH236 Semester 1, 2013 2 / 23

slide-3
SLIDE 3

Finding generators in Z∗

p

The multiplicative group

For a positive integer n, the multiplicative group of Zn is Z∗

n = {a ∈ Zn : gcd(a, n) = 1}

The group operation is multiplication modulo n The identity in Z∗

n is the number 1

Every element a ∈ Z∗

n has an inverse

The order of Z∗

n is hi(n)

If p is a prime, then Z∗

p = Zp − {0} = {1, 2, · · · , p − 1}

The order of a ∈ Z∗

n is the smallest positive integer k such that

ak = 1. We write |a| = k.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 3 / 23

slide-4
SLIDE 4

Finding generators in Z∗

p

The multiplicative group

Example Consider the group Z∗

15

We have Z∗

15 = {1, 2, 4, 7, 8, 11, 13, 14}

|Z∗

15| = 8 = hi(15) = 15(1 − 1 3)(1 − 1 5)

Order of 2 ∈ Z∗

15

k 2k mod 15 1 2 2 4 3 8 4 1 Thus |2| = 4 in Z∗

15.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 4 / 23

slide-5
SLIDE 5

Finding generators in Z∗

p

Finding generators

Theorem Suppose that p is a prime and α ∈ Z∗

  • p. Then α is a generator of Z∗

p if and

  • nly if

α(p−1)/q ≡ 1 (mod p) for all primes q such that q | (p − 1).

Tong-Viet (UKZN) MATH236 Semester 1, 2013 5 / 23

slide-6
SLIDE 6

Finding generators in Z∗

p

Finding generators

Example Consider the group Z∗

  • 37. We have 37 − 1 = 36 = 22 · 32.

For α ∈ Z∗

37, we need to compute

α36/2 (mod 37) α36/3 (mod 37)

If all the results are not trivial, then α is a generator of Z37. We have 218 ≡ 36 and 212 ≡ 26 (mod 37), so 2 is a generator of Z∗

37

However 418 ≡ 1 and 412 ≡ 10 (mod 37), so 4 is NOT a generator of Z∗

37

Is 31 a generator of Z∗

37?

Tong-Viet (UKZN) MATH236 Semester 1, 2013 6 / 23

slide-7
SLIDE 7

Review of Chapter 3

Elementary number theory

The Division Algorithm: Find gcd(a, b), with a, b ∈ Z The Extended Division Algorithm: Find s, t ∈ Z such that gcd(a, b) = as + bt Study the proofs of Lemma 24 and Theorem 25 Find the multiplicative inverses (using the Extended Division Algorithm) Study Theorems 26 and 27. (Existence and Uniqueness) Square and multiply in Zm

Tong-Viet (UKZN) MATH236 Semester 1, 2013 7 / 23

slide-8
SLIDE 8

Review of Chapter 3

Elementary number theory (cont.)

Prime numbers Euler’s hi-function Definition and how to compute hi(n) for n ∈ Z Theorems 30-32 and Theorem 33 (Formula for hi(n)) Fermat and Euler Theorems Find remainders and inverses using these theorems Definition of groups, order of elements and how to find a generator for Z∗

p.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 8 / 23

slide-9
SLIDE 9

Chapter 4. Fundamentals of cryptopology Introduction

Introduction

Further reading: Handbook of Applied Cryptography by Menezes, Oorschot and Vanstone Available at www.cacr.math.uwaterloo.ca/hac The word cryptopology was used for the first time by John Wilkins in 1641 This word comes from Greek words krypte: to hide and logos: word Cryptopology consists of two related disciplines: cryptography (graphein: to write) and cryptanalysis Cryptography was used by the Egyptians as early as 1900 BC Classical ciphers are simple substitutions (shift ciphers, block ciphers) with a shared private key If we know how to encrypt, we can decrypt the message easily.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 9 / 23

slide-10
SLIDE 10

Chapter 4. Fundamentals of cryptopology Introduction

Introduction

In modern times, cryptography has been used by the governments, military and now by commercial entities Public key cryptograph, invented in 1976, is the modern cryptograph and the most widely used public key system is the RSA cryptosystem In RSA crypto system, we encrypt the message using modular exponentiation, where the modulus is the product of two large primes To decrypt the message, we need to know the prime factors of the

  • modulus. However, the factorisation is a difficult problem.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 10 / 23

slide-11
SLIDE 11

Chapter 4. Fundamentals of cryptopology Introduction

Definition of cryptograph

Definition Cryptography is the study of mathematical techniques to provide information security such as Confidentiality: Ensuring that only the intended recipient of the message is able to understand it Data integrity: Preventing the unauthorized alteration of data Authentication: Providing assurance that both sender and recipient are who they say they are, and that the message comes from where it is supposed to and goes where it is supposed to Non-repudiation: Preventing parties from denying previously made commitments

Tong-Viet (UKZN) MATH236 Semester 1, 2013 11 / 23

slide-12
SLIDE 12

Chapter 4. Fundamentals of cryptopology Introduction

Definition of cryptanalysis

Definition Cryptanalysis is the study of mathematical techniques to defeat information security.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 12 / 23

slide-13
SLIDE 13

Chapter 4. Fundamentals of cryptopology Introduction

Definitions and Terminology

Definition plaintext (message) M is a finite string of symbols from a finite alphabet Σ (Latin alphabet, binary alphabet) M is converted, by the process of encryption (enciphering) into an enciphered text called the ciphertext (cryptogram) C The person who enciphered M is called the sender or encipherer. He used a set of rules or algorithm to encrypt M The sender sends the ciphertext C to the intended recipient (receiver) The algorithm involves the use of a key K which is known to both sender and receiver

Tong-Viet (UKZN) MATH236 Semester 1, 2013 13 / 23

slide-14
SLIDE 14

Chapter 4. Fundamentals of cryptopology Introduction

Definitions and Terminology

Definition The receiver uses an algorithm (involving the key) to obtain M from

  • C. This is known as decryption (deciphering)

The ciphered text C and the key K must determine the plaintext M uniquely. The plaintext will be written in lowercase and ciphertext in uppercase Any person who intercepts the message is called an inceptor The methods used in the encryption/decryption above form the subject of cryptography The methods used by the inceptor to derive M from C without having access to the key are studies in cryptanalysis.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 14 / 23

slide-15
SLIDE 15

Chapter 4. Fundamentals of cryptopology Introduction

Principle of Cryptography

Tong-Viet (UKZN) MATH236 Semester 1, 2013 15 / 23

slide-16
SLIDE 16

Chapter 4. Fundamentals of cryptopology Monoalphabetic and Polyalphabetic ciphers

Encryption schemes

There are two classes of encryption schemes Monoalphabetic cipher: each letter in the plaintext alphabet is always encrypted as the same letter in the ciphertext alphabet. Polyalphabetic cipher: a letter in the plaintext alphabet might be encrypted as several different letters in the ciphertext.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 16 / 23

slide-17
SLIDE 17

Chapter 4. Fundamentals of cryptopology Monoalphabetic and Polyalphabetic ciphers

Monoalphabetic ciphers

Simple substitution ciphers: we replace each letter of the alphabet by another. In other words, a simple substitution cipher is a permutation of the letters of the alphabet Shift ciphers: (used by Julius Caesar) each of the letters a, b, · · · z is replaced by the letter which occurs three places after it in the alphabet.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 17 / 23

slide-18
SLIDE 18

Chapter 4. Fundamentals of cryptopology Monoalphabetic and Polyalphabetic ciphers

Simple substitution ciphers

Example Suppose that the following key is used: Plaintext a b c d e f · · · t u v w · · · Ciphertext D X W E G A · · · B F R C · · · Both the encipherer and decipherer have a copy of this key The plaintext ‘fat’ is enciphered as ‘ADB’ The ciphertext ‘WDB’ is deciphered as ‘cat’ The reordered alphabet (DXWEGA · · · BFRC · · · ) is called the substitution alphabet This is a very poor system. It is easy to cryptanalyze. Memorizing the key is difficult. If the key is kept, it can be lost or stolen.

Tong-Viet (UKZN) MATH236 Semester 1, 2013 18 / 23

slide-19
SLIDE 19

Chapter 4. Fundamentals of cryptopology Monoalphabetic and Polyalphabetic ciphers

Shift ciphers

Example The key of Caesar shift cipher is represented by the following permutation Plaintext a b c d e f · · · w x y z Ciphertext D E F G H I · · · Z A B C We call this a shifter cipher, or additive cipher or translation cipher with shift (or key) 3 In general, we can use a shift cipher with key d This is a special case of simple substitution cipher The key is easily remember but the cipher is insecure

Tong-Viet (UKZN) MATH236 Semester 1, 2013 19 / 23

slide-20
SLIDE 20

Chapter 4. Fundamentals of cryptopology Monoalphabetic and Polyalphabetic ciphers

Polyalphabetic ciphers

a specific ciphertext letter can represent more than one plaintext each plaintext letter can be encrypted in more than one way There are several ways to do this but we must be sure that whatever we do, we can still decipher the message. We will look at ‘n-gram substitution’ and ‘permutation cipher’

Tong-Viet (UKZN) MATH236 Semester 1, 2013 20 / 23

slide-21
SLIDE 21

Chapter 4. Fundamentals of cryptopology Monoalphabetic and Polyalphabetic ciphers

n-gram substitution

an n-gram is a sequence of n letters A single letter is a 1-gram; a sequence of two letters is a 2-gram or digram and a sequence of three letters is a 3-gram or trigram In n-gram substitution, we replace each n-gram of plaintext with an n-gram of ciphertext

Tong-Viet (UKZN) MATH236 Semester 1, 2013 21 / 23

slide-22
SLIDE 22

Chapter 4. Fundamentals of cryptopology Monoalphabetic and Polyalphabetic ciphers

n-gram substitution

Suppose part of the key for a digram encryption scheme is a b · · · x y z . . . c MZ BQ JA DD FK d IA DT TB AT ZS e LP SX AM EO BR . . . k BA AC QP MN LA l WF EH GO BJ RE m CT MB CW HP IS . . . Then the word ‘lady’ would be encrypted as ‘WFAT’ The ciphertext ‘MZAT’ is deciphered as ‘cady’

Tong-Viet (UKZN) MATH236 Semester 1, 2013 22 / 23

slide-23
SLIDE 23

Chapter 4. Fundamentals of cryptopology Monoalphabetic and Polyalphabetic ciphers

Permutation ciphers

A block cipher is an encryption scheme in which the plaintext message is broken up into blocks of fixed length d each of which is then encrypted separately In a digram substitution scheme, each block has length d = 2

Tong-Viet (UKZN) MATH236 Semester 1, 2013 23 / 23