Basic Concepts in Number Theory and Finite Fields

Similar documents
Chapter 4 Finite Fields

Other Public-Key Cryptosystems

Mathematical Foundations of Cryptography

Finite Fields. Mike Reiter

2 k Factorial Designs Raj Jain Washington University in Saint Louis Saint Louis, MO These slides are available on-line at:

Lecture 3.1: Public Key Cryptography I

Introduction to Information Security

Other Public-Key Cryptosystems

Number Theory. Raj Jain. Washington University in St. Louis

Public Key Algorithms

Chapter 4 Mathematics of Cryptography

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

Lecture 6: Finite Fields (PART 3) PART 3: Polynomial Arithmetic. Theoretical Underpinnings of Modern Cryptography

NUMBER THEORY. Anwitaman DATTA SCSE, NTU Singapore CX4024. CRYPTOGRAPHY & NETWORK SECURITY 2018, Anwitaman DATTA

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162

Introduction to Modern Cryptography. (1) Finite Groups, Rings and Fields. (2) AES - Advanced Encryption Standard

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Commutative Rings and Fields

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

Mathematics for Cryptography

3 The fundamentals: Algorithms, the integers, and matrices

Rings. EE 387, Notes 7, Handout #10

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

Finite Fields. SOLUTIONS Network Coding - Prof. Frank H.P. Fitzek

4 Number Theory and Cryptography

Basic elements of number theory

Basic elements of number theory

cse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications

ECEN 5022 Cryptography

Number Theory. Modular Arithmetic

CS483 Design and Analysis of Algorithms

Fields in Cryptography. Çetin Kaya Koç Winter / 30

MATH 3030, Abstract Algebra FALL 2012 Toby Kenney Midyear Examination Friday 7th December: 7:00-10:00 PM

Mathematical Foundations of Public-Key Cryptography

CS 4770: Cryptography. CS 6750: Cryptography and Communication Security. Alina Oprea Associate Professor, CCIS Northeastern University

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example.

LECTURE NOTES IN CRYPTOGRAPHY

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

RINGS: SUMMARY OF MATERIAL

Intro to Rings, Fields, Polynomials: Hardware Modeling by Modulo Arithmetic

Encryption: The RSA Public Key Cipher

Galois Fields and Hardware Design

Numbers. Çetin Kaya Koç Winter / 18

MTH310 EXAM 2 REVIEW

Discrete Mathematics GCD, LCM, RSA Algorithm

Introduction to Queueing Theory

Integers and Division

Finite Fields. Saravanan Vijayakumaran Department of Electrical Engineering Indian Institute of Technology Bombay

Outline. MSRI-UP 2009 Coding Theory Seminar, Week 2. The definition. Link to polynomials

Coding Theory ( Mathematical Background I)

Congruences and Residue Class Rings

Ch 4.2 Divisibility Properties

Introduction to Cryptology. Lecture 19

Know the meaning of the basic concepts: ring, field, characteristic of a ring, the ring of polynomials R[x].

1. Algebra 1.5. Polynomial Rings

Homework 8 Solutions to Selected Problems

Continuing discussion of CRC s, especially looking at two-bit errors

Algebra Homework, Edition 2 9 September 2010

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank

With Question/Answer Animations. Chapter 4

CSC 474 Information Systems Security

Definition For a set F, a polynomial over F with variable x is of the form

4 Powers of an Element; Cyclic Groups

Chapter 7: Exponents

The Euclidean Algorithm and Multiplicative Inverses

Groups, Rings, and Finite Fields. Andreas Klappenecker. September 12, 2002

Remainders. We learned how to multiply and divide in elementary

Finite Fields: An introduction through exercises Jonathan Buss Spring 2014

Computations/Applications

REVIEW Chapter 1 The Real Number System

An Introduction to Proof-based Mathematics Harvard/MIT ESP: Summer HSSP Isabel Vogt

Abstract Algebra, Second Edition, by John A. Beachy and William D. Blair. Corrections and clarifications

Properties of Real Numbers

Lecture 11: Number Theoretic Assumptions

SM9 identity-based cryptographic algorithms Part 1: General

Outline. Number Theory and Modular Arithmetic. p-1. Definition: Modular equivalence a b [mod n] (a mod n) = (b mod n) n (a-b)

A Generalization of Wilson s Theorem

Math 312/ AMS 351 (Fall 17) Sample Questions for Final

William Stallings Copyright 2010

MTH 310, Section 001 Abstract Algebra I and Number Theory. Sample Midterm 1

Lecture 7: Polynomial rings

8 Primes and Modular Arithmetic

1 2 3 style total. Circle the correct answer; no explanation is required. Each problem in this section counts 5 points.

CHAPTER 10: POLYNOMIALS (DRAFT)

ICS141: Discrete Mathematics for Computer Science I

Introduction. will now introduce finite fields of increasing importance in cryptography. AES, Elliptic Curve, IDEA, Public Key

Applied Cryptography and Computer Security CSE 664 Spring 2017

Topics in Cryptography. Lecture 5: Basic Number Theory

Introduction to finite fields

Foundations of Cryptography

Polynomials. Chapter 4

2a 2 4ac), provided there is an element r in our

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

Introduction to Cryptography k. Lecture 5. Benny Pinkas k. Requirements. Data Integrity, Message Authentication

Ch 7 Summary - POLYNOMIAL FUNCTIONS

COLLEGE ALGEBRA. Properties of Real Numbers with Clock Arithmetic

Solutions to Assignment 3

Transcription:

Basic Concepts in Number Theory and Finite Fields Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 Jain@cse.wustl.edu Audio/Video recordings of this lecture are available at: 4-1 Overview 1. The Euclidean Algorithm for GCD 2. Modular Arithmetic 3. Groups, Rings, and Fields 4. Galois Fields GF(p) 5. Polynomial Arithmetic These slides are partly based on Lawrie Brown s slides supplied with William Stalling s book Cryptography and Network Security: Principles and Practice, 7 th Ed, 2017. 4-2 Euclid's Algorithm Goal: To find greatest common divisor Example: gcd(10,25)=5 using long division 10) 25 (2 20 -- 5)10 (2 10 -- 00 Test: What is GCD of 12 and 105? Euclid's Algorithm: Tabular Method x y r i = u i x + v i y u i = u i-2 - q i u i-1 v i = v i-2 - q i v i-1 Finally, If r i = 0, gcd(x,y) = r i-1 1. Write the first 2 rows. Set i = 2. 2. Divide r i-1 by r i, write quotient q i+1 on the next row 3. Fill out the remaining entries in the new bottom row: a. Multiply r i by q i+1 and subtract from r i-1 b. Multiply u i by q i+1 and subtract from u i-1 c. Multiply v i by q i+1 and subtract from previous v i-1 4-3 4-4

Euclid s Algorithm Tabular Method (Cont) Tabular Method (Cont) Example 2: Fill in the blanks 4-5 Example 2: Fill in the blanks 8 1 5 q i r i u i v i 15 0 1 8 1 0 1 7-1 1 1 1 2-1 7 0-15 - 8 GCD(8,15) = 1 r i = u i x + v i y If gcd(x, y) = 1, 1=2*8-1*15 or 2*8 = 1+1*15 2*8 mod 15 = (1+1*15)mod 15 = 1 Inverse of 8 = 2 mod 15 In general, u i x + v i y = 1 x -1 mod y = u i u i is the inverse of x in mod y arithmetic. 4-6 Homework 4A Find the multiplicative inverse of 5678 mod 8765 Do it on your own. Do not submit. Answer: 2527 4-7 Modular Arithmetic xy mod m = (x mod m) (y mod m) mod m (x+y) mod m = ((x mod m)+ (y mod m)) mod m (x-y) mod m = ((x mod m)- (y mod m)) mod m x 4 mod m = (x 2 mod m)(x 2 mod m) mod m x ij mod m = (x i mod m) j mod m 125 mod 187 = 125 (225+285) mod 187 = (225 mod 187) + (285 mod 187) = 38+98 = 136 125 2 mod 187 = 15625 mod 187 = 104 125 4 mod 187 = (125 2 mod 187) 2 mod 187 = 104 2 mod 187 = 10816 mod 187 = 157 125 6 mod 187 = 125 4+2 mod 187 = (157 104) mod 187 = 59 4-8

Modular Arithmetic Operations Modular Arithmetic Properties Z = Set of all integers = {, -2, -1, 0, 1, 2, } Z n = Set of all non-negative integers less than n = {0, 1, 2,, n-1} Z 2 = {0, 1} Z 8 = { 0, 1, 2, 3, 4, 5, 6, 7} Addition, Subtraction, Multiplication, and division can all be defined in Z n For Example: (5+7) mod 8 = 4 (4-5) mod 8 = 7 (5 7) mod 8 = 3 (3/7) mod 8 = 5 (5*5) mod 8 = 1 4-9 4-10 Homework 4B Group Determine 125 107 mod 187 Do it on your own. Do not submit. Answer: 5 Group: A set of elements that is closed with respect to some operation. Closed The result of the operation is also in the set The operation obeys: Obeys associative law:(a.b).c = a.(b.c) Has identity e: e.a = a.e = a Has inverses a -1 : a.a -1 = e Abelian Group: The operation is commutative a.b = b.a Example: Z 8, + modular addition, identity =0 4-11 4-12

Cyclic Group Exponentiation: Repeated application of operator example: a 3 = a.a.a Cyclic Group: Every element is a power of some fixed element, i.e., b = a k for some a and every b in group a is said to be a generator of the group Example: {1, 2, 4, 8} with mod 12 multiplication, the generator is 2. 2 0 =1, 2 1 =2, 2 2 =4, 2 3 =8, 2 4 =4, 2 5 =8 4-13 Ring Ring: 1. A group with two operations: addition and multiplication 2. The group is Abelian with respect to addition: a+b = b+a 3. Multiplication and additions are both associative: a+(b+c)=(a+b)+c a.(b.c)=(a.b).c 1. Multiplication distributes over addition a.(b+c)=a.b+a.c (a+b).c = a.c + b.c Commutative Ring: Multiplication is commutative, i.e., a.b = b.a Integral Domain: multiplication operation has an identity and no zero divisors Ref: http://en.wikipedia.org/wiki/ring_%28mathematics%29 4-14 Homework 4C Consider the set S = {a, b, c} with addition and multiplication defined by the following tables: + a b c a a b c b b a c c c c a Is S a ring? Justify your answer. a b c a a b c b b b b c c b c Field Field: An integral domain in which each element has a multiplicative inverse. 4-15 4-16

Finite Fields or Galois Fields Finite Field: A field with finite number of elements Also known as Galois Field The number of elements is always a power of a prime number. Hence, denoted as GF(p n ) GF(p) is the set of integers {0,1,, p-1} with arithmetic operations modulo prime p Can do addition, subtraction, multiplication, and division without leaving the field GF(p) GF(2) = Mod 2 arithmetic GF(8) = Mod 8 arithmetic There is no GF(6) since 6 is not a power of a prime. GF(7) Multiplication Example 0 1 2 3 4 5 6 0 0 0 0 0 0 0 0 1 0 1 2 3 4 5 6 2 0 2 4 6 1 3 5 3 0 3 6 2 5 1 4 4 0 4 1 5 2 6 3 5 0 5 3 1 6 4 2 6 0 6 5 4 3 2 1 4-17 4-18 Polynomial Arithmetic f(x) = a n x n + a n-1 x n-1 + + a 1 x + a 0 = a i x i 1. Ordinary polynomial arithmetic: Add, subtract, multiply, divide polynomials, Find remainders, quotient. Some polynomials have no factors and are prime. 2. Polynomial arithmetic with mod p coefficients 3. Polynomial arithmetic with mod p coefficients and mod m(x) operations, where m(x) is a n th degree polynomial = GF(p n ) 4-19 Polynomial Arithmetic with Mod 2 Coefficients All coefficients are 0 or 1, e.g., let f(x) = x 3 + x 2 and g(x) = x 2 + x + 1 f(x) + g(x) = x 3 + x + 1 f(x) g(x) = x 5 + x 2 Polynomial Division: f(x) = q(x) g(x) + r(x) r(x) = remainder = f(x) mod g(x) if no remainder, say g(x) divides f(x) if g(x) has no divisors other than itself & 1 say it is irreducible (or prime) polynomial Arithmetic modulo an irreducible polynomial forms a finite field Can use Euclid s algorithm to find gcd and inverses. 4-20

Example GF(2 3 ) Computational Example in GF(2n) Since coefficients are 0 or 1, any polynomial can be represented as a bit string In GF(2 3 ), (x 2 +1) is 101 2 & (x 2 +x+1) is 111 2 Addition: (x 2 +1) + (x 2 +x+1) = x 101 111 = 010 2 Multiplication: (x+1).(x 2 +1) = x.(x 2 +1) + 1.(x 2 +1) = x 3 +x+x 2 +1 = x 3 +x 2 +x+1 011.101 = 1111 2 Polynomial modulo reduction (get q(x) & r(x)) is (x 3 +x 2 +x+1 ) mod (x 3 +x+1) = 1.(x 3 +x+1) + (x 2 ) = x 2 4-21 1111 mod 1011 = 1111 1011 = 0100 2 4-22 Homework 4D Using a Generator Determine the gcd of the following pairs of polynomials over GF(11) 5x 3 +2x 2-5x-2 and 5x 5 +2x 4 +6x 2 +9x A generator g is an element whose powers generate all nonzero elements in F F={0, g 0, g 1,, g q-2 } Can create generator from root of the irreducible polynomial then adding exponents of generator 4-23 4-24

Summary 1. Euclid s tabular method allows finding gcd and inverses 2. Group is a set of element and an operation that satisfies closure, associativity, identity, and inverses 3. Abelian group: Operation is commutative 4. Rings have two operations: addition and multiplication 5. Fields: Commutative rings that have multiplicative identity and inverses 6. Finite Fields or Galois Fields have p n elements where p is prime 7. Polynomials with coefficients in GF(2 n ) also form a field. 4-25 Lab 4: Brute Force Password Cracking Goal: Find user passwords from the password file. This lab consists of using the following two tools: 1. Password dump Pwdump7 to retrieve the password file, http://www.openwall.com/passwords/microsoft-windows-nt- 2000-xp-2003-vista-7#pwdump 2. John the ripper V1.8, Brute force password cracker to decode the entry http://www.openwall.com/john/ Throughout the lab, please note down the commands as indicated so that you can submit them as the solution. Remote desktop via VPN to CSE571XPS Use the common student account 4-26 Step 1: Get the Password File Read about pwdump Remote access the student account on CSE571XPS, open Command Prompt CD to c:/ Run pwdump7 -h to get some help Run pwdump7 with appropriate parameters to get the hash file from CSE571XPS. Note down the command you used. Open the hash file obtained in notepad. Delete all lines except the one with your last name. Save the file as c:\john180\run\<your_last_name>.txt Delete the original full hash file that you downloaded 4-27 Step 2: Find Your Password CD to c:\john180\run Delete john.pot and john.log, if present. Run John to get help and read all the options Run John with the file you created in step 1 Your password is CseXXXX where X is a decimal digit [0-9]. Use correct options to search only for the specified pattern. (Otherwise, John will take very long) If John takes more than one minute to finish then you have not chosen the correct options After John finishes. Note down the contents of john.pot file and submit. Delete your hash file, john.pot, and john.log 4-28

3. Change Your Password Logout from the common student account and close your remote desktop connection Start a new remote desktop connection using your last name as username and the password you obtained in Step 2. Change your password to a stronger password of your choice. Do this from your own account (not the common student account). Note the time and date you change the password. Submit the time as answer. Logout and close your remote desktop connection Scan This to Download These Slides Raj Jain http://rajjain.com 4-29 4-30 Related Modules CSE571S: Network Security (Spring 2017), index.html CSE473S: Introduction to Computer Networks (Fall 2016), http://www.cse.wustl.edu/~jain/cse473-16/index.html Wireless and Mobile Networking (Spring 2016), http://www.cse.wustl.edu/~jain/cse574-16/index.html CSE571S: Network Security (Fall 2014), http://www.cse.wustl.edu/~jain/cse571-14/index.html Audio/Video Recordings and Podcasts of Professor Raj Jain's Lectures, https://www.youtube.com/channel/ucn4-5wznp9-ruozqms-8nuw 4-31