Quick reviews / corrections

Slides:



Advertisements
Similar presentations
1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
Advertisements

Finite Fields Rong-Jaye Chen. p2. Finite fields 1. Irreducible polynomial f(x)  K[x], f(x) has no proper divisors in K[x] Eg. f(x)=1+x+x 2 is irreducible.
BCH Codes Hsin-Lung Wu NTPU.
Cryptography and Network Security
Chapter 4 Finite Fields. Introduction of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key concern operations on “numbers”
Chapter 4 – Finite Fields. Introduction will now introduce finite fields of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key.
Cryptography and Network Security Chapter 4
Cryptography and Network Security Chapter 4 Fourth Edition by William Stallings.
Introduction Polynomials
Chapter 4 – Finite Fields Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public.
WHOLE NUMBERS; INTEGERS Whole numbers: Z 0,+ = the natural numbers  {0}. Integers:
FINITE FIELDS 7/30 陳柏誠.
CPSC 3730 Cryptography and Network Security
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
Information Security and Management 4. Finite Fields 8
Cryptography and Network Security Introduction to Finite Fields.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
Groups Definition A group  G,  is a set G, closed under a binary operation , such that the following axioms are satisfied: 1)Associativity of  :
Basic Number Theory Divisibility Let a,b be integers with a≠0. if there exists an integer k such that b=ka, we say a divides b which is denoted by a|b.
Chapter 4 – Finite Fields
Public key ciphers 2 Session 6.
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
Rational Numbers and Fields
Scott CH Huang COM5336 Cryptography Lecture 11 Euclidean Domains & Division Algorithm Scott CH Huang COM 5336 Cryptography Lecture 10.
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Modular Arithmetic and the RSA Cryptosystem Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2005 Lecture 9Sept 27, 2005Carnegie.
Great Theoretical Ideas In Computer Science Anupam GuptaCS Fall 2006 Lecture 15Oct 17, 2006Carnegie Mellon University Algebraic Structures: Groups,
CS Lecture 14 Powerful Tools     !. Build your toolbox of abstract structures and concepts. Know the capacities and limits of each tool.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
Chapter 13 Mathematic Structures 13.1 Modular Arithmetic Definition 1 (modulo). Let a be an integer and m be a positive integer. We denoted by a mod m.
Great Theoretical Ideas In Computer Science COMPSCI 102 Fall 2010 Lecture 16October 27, 2010Duke University Modular Arithmetic and the RSA Cryptosystem.
Cryptography Lecture 14 Arpita Patra © Arpita Patra.
Chapter 1 Algorithms with Numbers. Bases and Logs How many digits does it take to represent the number N >= 0 in base 2? With k digits the largest number.
Multiplicative Group The multiplicative group of Z n includes every a, 0
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Great Theoretical Ideas in Computer Science.
Discrete Math II Howon Kim
Modular Arithmetic and the RSA Cryptosystem
Topic 26: Discrete LOG Applications
CS480 Cryptography and Information Security
Topic 12: Number Theory Basics (2)
Great Theoretical Ideas in Computer Science
Advanced Algorithms Analysis and Design
Prelude to Public-Key Cryptography
Advanced Algorithms Analysis and Design
Number-Theoretic Algorithms (UNIT-4)
Great Theoretical Ideas In Computer Science
RSA and El Gamal Cryptosystems
Authenticated encryption
Elliptic Curves.
Group theory exercise.
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Number Theory and Modular Arithmetic
Number Theory (Chapter 7)
Topic 25: Discrete LOG, DDH + Attacks on Plain RSA
Prime and Relatively Prime Numbers
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Modular Arithmetic and the RSA Cryptosystem
Great Theoretical Ideas in Computer Science
Cryptography and Network Security
Lecture 3.1: Public Key Cryptography I
Great Theoretical Ideas in Computer Science
Algebraic Structures: Group Theory
Copyright © Zeph Grunschlag,
Mathematical Background for Cryptography
Cryptography Lecture 19.
Lecture 3 Strings and Things (Section 1.1)
Presentation transcript:

Quick reviews / corrections

Question Review 4 Important lesson: Authentication does not imply encryption Second lesson: pay attention to the definition

Some people would have said that the left is an authentication scheme and the right one isn’t

Mac forgery game M ←{} k ∈ 𝑅 0,1 𝑠 𝑚′ M←𝑀∪{𝑚′} Repeat as many times as the adversary wants 𝑡′ ←𝑚𝑎 𝑐 𝑘 (𝑚′) 𝑡′ Wins if 𝑚 ∉𝑀 𝑣𝑒𝑟𝑖𝑓𝑦 𝑚,𝑡 =1 (𝑚,𝑡)

Some people would have said that the left is an authentication scheme and the right one isn’t We can take a mac that is accepted on the right side and easily turn it into a mac on the left

Strong version of the mac forgery game k ∈ 𝑅 0,1 𝑠 𝑚′ Repeat as many times as the adversary wants 𝑡′ ←𝑚𝑎 𝑐 𝑘 (𝑚′) 𝑡′ S←𝑆∪{( 𝑚 ′ , 𝑡 ′ )} Wins if (𝑚,𝑡) ∉𝑆 𝑣𝑒𝑟𝑖𝑓𝑦 𝑚,𝑡 =1 (𝑚,𝑡)

Mac game comparison If a scheme (gen,mac,verify) is a strong mac scheme then it is also a mac scheme, the other way does not hold

According to the definition of strong authentication If (Gen,Mac,Verify) is a strong mac then the left scheme is a strong mac scheme but not the right scheme

Interesting lesson Some definitions of security for a task are stronger. Depending on your variant of a definitions a schemes can be considered secure depending on which definition you use We say that definition A implies definition B (A>B) if every scheme which satisfies definition A also satisfies definition B CCA => CPA CPA => distinguishability Strong authentication => weak authentication You need precisely to look at a definition to see if a scheme fulfills or not

CCA game (chosen ciphertext) In the CCA game the adversary also gets to encrypt messages of his choice

Groups, fields, primes

Divisibility Definition: 𝑎 divides n written as 𝑎 𝑛) if there exists a number c such that 𝑐𝑎=𝑛 𝐺𝐶𝐷 𝑎,𝑏 ≔ max 𝑥∈ℕ (𝑥 𝑎 ) 𝑎𝑛𝑑 (𝑥 𝑏)

Finding the GCD If (𝑏 | 𝑎) then 𝐺𝐶𝐷 𝑎,𝑏 =𝑏 𝐺𝐶𝐷(𝑎,𝑏) = 𝐺𝐶𝐷(max⁡(𝑎,𝑏),m𝑖𝑛⁡(𝑎,𝑏)) (a>b) ⇒ 𝐺𝐶𝐷 𝑎,𝑏 =𝐺𝐶𝐷(𝑎−𝑏,𝑏)

Simple algorithm for GCD GCD(a,b) if (𝑎<𝑏) 𝑟𝑒𝑡𝑢𝑟𝑛 𝐺𝐶𝐷(𝑏,𝑎) if (𝑎 % 𝑏 == 0) return 𝑏; return 𝐺𝐶𝐷(𝑎−𝑏,𝑏)

Proposition 8.3 Let 𝑎,𝑏 then there exists positive integers X,Y such that Xa + Yb = gcd(a,b) Given u < n, we want to find v such that u∗𝑣 𝑚𝑜𝑑 𝑛=1 Equivalent to finding v : 𝑢𝑣 +𝑌𝑛=1

Simple algorithm for GCD GCD(a,b) if (𝑎 % 𝑏 == 0) return 𝑏 if (𝑎<𝑏) return 𝐺𝐶𝐷(𝑎,𝑏) return 𝐺𝐶𝐷(𝑏, 𝑎 % 𝑏)

Extended GCD algorithm Same as GCD except that for a,b we also want to find We also want to find 𝑋,𝑌 such that 𝑎𝑋+𝑏𝑌 = 𝐺𝐶𝐷(𝑎,𝑏) Help us find inverse Given u < n, we want to find v such that u∗𝑣 𝑚𝑜𝑑 𝑛=1 Equivalent to finding v : 𝑢𝑣 +𝑌𝑛=1 Can use EGC to find v

Extended GCD algorithm EGCD(a,b) if (𝑎<𝑏) return 𝐸𝐺𝐶𝐷(𝑏,𝑎) if(b divides a) return (𝑏,0,1) // Compute 𝑞,𝑟 such that 𝑎 = 𝑞𝑏 + 𝑟 𝑞 = 𝑎 / 𝑏 𝑟 = 𝑎−𝑞𝑏 𝑑,𝑥,𝑦 ←𝑒𝐺𝐶𝐷(𝑏,𝑟) return 𝐸𝐺𝐶𝐷(𝑑, 𝑦,𝑥−𝑦𝑞)

Multiplicative inverse The multiplicative inverse of x in 𝑍 𝑛 𝑦∈ 𝑍 𝑛 such that 𝑥× 𝑦 = 1 (𝑚𝑜𝑑 𝑛)

Relatively prime We say that two numbers 𝑎,𝑏 are relatively prime (co-prime) 𝐺𝐶𝐷(𝑎,𝑏) = 1 Examples 15,32 24, 35 Non-example 2,14 3, 183

Theorem on relatively prime If 𝑎>𝑏 then there exists unique 𝑝, 𝑟 < 𝑎 a=b𝑞 + 𝑟

Group A group Consists Extra property Set 𝑆 Operation ⊙ :𝑆×𝑆→𝑆 Identity-element Properties Closure 𝑥,𝑦∈ 𝑆⇒ 𝑥⊙𝑦∈𝑆 Identity ∃ 𝑒∈𝑆 : 𝑥∈𝑆⇒ 𝑒⊙𝑥=𝑥 (we use e to denote the identity element) Associativity 𝑥,𝑦,𝑧∈ 𝑆⇒ x⊙𝑦 ⊙𝑧⇒𝑥⊙(𝑦⊙𝑧) Inverse: 𝑥∈𝑆⇒∃ 𝑦∈𝑆 :𝑥⊙𝑦=𝑒 Extra property Commutativity: 𝑥,𝑦∈ 𝑆⇒ 𝑥⊙𝑦=𝑦⊙𝑥

Examples of groups (𝑍 𝑛 ,+) is a group where + is addition mod n Closure 𝑥,𝑦∈ 𝑍 𝑛 => 𝑥+𝑦∈ 𝑍 𝑛 Identity e = 0, we have that x+0 = x Associativity x+y+z = (x + y) + z = x + (y+z) Inverse : x + (n-x) = 0

Examples of group (𝑍 𝑝 ∖ 0 , ∗) is a group if p is prime Closure 𝑥∗𝑦∈ 𝑍 𝑝 Identity e = 1, we have that 𝑥×1 =𝑥 Associativity 𝑥∗𝑦∗𝑧 = 𝑥 ∗ 𝑦 ∗ 𝑧 = 𝑥 ∗ (𝑦∗𝑧) Inverse : For each u there exists 𝑣,𝑦 such that 𝑢𝑣 + 𝑦𝑛 = gcd⁡(𝑎,𝑛) = 1 𝑢𝑣+𝑦𝑛 𝑚𝑜𝑑 𝑛 =𝑢𝑣=1 v is the inverse

Examples of group (𝑍 𝑛 ∖ 0 , ∗) is not a group if n is not prime Closure, Identity and associativity hold There exists 𝑢 without an inverse : Choose 𝑢 such that 𝐺𝐶𝐷 𝑢,𝑛 =𝑐≠ 1 (must exists since n is not prime) 𝑢 ′ 𝑐 =𝑢 𝑛 ′ 𝑐 =𝑛 𝑢𝑣 𝑚𝑜𝑑 𝑛 = 𝑐 𝑢 ′ 𝑣 𝑚𝑜𝑑 𝑐 𝑛 ′ =𝑐 𝑢 ′ 𝑣 (𝑚𝑜𝑑 𝑐𝑛′) If exists x such that cx (mod cn’) = 1 Then there exists z such that 𝑐𝑥 = 1 + 𝑐 𝑛 ′ 𝑧 This implies that 𝑐(𝑥− 𝑛 ′ 𝑧) = 1 Can only occur if c=1 which contradicts the fact that 𝑐≠1

Examples of group Examples of group Non-group Numbers with addition Real with addition Rationals with addition Non-group Positive numbers under addition (no inverse) Odd numbers (not closed under addition)

Exponential in groups We use 𝑔⋅𝑚 𝑖𝑛𝑠𝑡𝑒𝑎𝑑 𝑜𝑓 𝑔 𝑚 𝑤ℎ𝑒𝑛 𝑡ℎ𝑒 𝑔𝑟𝑜𝑢𝑝 𝑔 𝑖𝑠 𝑎𝑑𝑑𝑖𝑡𝑖𝑣𝑒 Definition 𝑔 1 = 𝑔 𝑔 𝑖 = 𝑔× 𝑔 𝑖−1 Linear time Fast evaluation 𝑔 1 =𝑔 𝑔 2𝑖 = 𝑔 2 𝑖 𝑔 2𝑖+1 = 𝑔 2 𝑖 ×𝑔 Logarithmic time

Properties of group Let G≔ (𝑆, ⋅) be a group, |𝐺| = |𝑆| = 𝑚 and let 𝑔∈ 𝑆 Theorem: 𝑔 𝑚 =1 Theorem: 𝑔 𝑥 = 𝑔 𝑥 𝑚𝑜𝑑 𝑚

𝑍 𝑛 ∗ 𝑍 𝑛 ∗ ≔ 𝑥∈ 𝑍 𝑛 𝐺𝐶𝐷 𝑥,𝑛 =1} 𝑍 𝑛 ∗ ,× is an abelian group when × denotes modular multiplication 𝑍 𝑛 Going to be critical for many cryptosystems.

Subgroup generated from an element Let G≔ (𝑆, ⋅) be a group and let 𝑔∈ 𝑆 We denote 𝐺 𝑆 ≔ ∪ 𝑖=1 ∞ 𝑔 𝑖 Theorem: (𝐺 𝑆 ,×) is a group (we say that 𝐺 𝑠 is a subgroup by G) We say that 𝑔 generates 𝐺 if 𝐺 𝑠 =𝐺

Subgroup generated from an element Let G≔ (𝑆, ×) be a group and let 𝑔∈ 𝑆 We denote 𝐺 𝑆 ≔ ∪ 𝑖=1 ∞ 𝑔 𝑖 where 𝑔 𝑖 = 𝑔×⋯× 𝑔 (n times) Theorem: |𝐺 𝑆 | divides |G| We say that 𝑔 generates 𝐺 if |𝐺 𝑠 |=|𝐺|

Discrete logarithm Given group G, generator g, For a given y find x such 𝑔 𝑥 =𝑦 Reminder g is a generator if {𝑔 𝑖 𝑖∈𝑁 ≔𝐺 Cryptographers hope that in certain groups, finding g is hard.

Field Field Consists Properties Set S Operations +,× Zero-element 0 One-element 1 Properties (𝑆,+) is a commutative group with identity element 0 (inverse of a is –𝑎) 𝑆∖ 0 ,× is a commutative group with identity element 1 (inverse of 𝑎 is 𝑎 −1 =1/𝑎) Distributivity:

Example of field ( 𝑍 𝑝 ,+,∗) is a field if p is prime Distributivity 𝑎∗(𝑏+𝑐) = 𝑎𝑏 + 𝑎𝑐 ( 𝑍 𝑝 ,+,∗) is not a field if p is not prime

Message authentication code Worked because it was a field Did not work when it was not a field

Are there finite fields that do not have prime size Yes Conditions: Every finite field must have size of the form 𝑝 𝑘 For every such size there exists such a finite field

Finite Fields for 2 8 S = polynomials 𝑎 0 + 𝑎 1 𝑥 +⋯ + 𝑎 7 𝑥 7 𝑎 𝑗 ∈ {0,1} Map each string to a polynomial 𝑎 0 ,⋯, 𝑎 7 → 𝑎 0 + 𝑎 1 𝑥 +⋯ + 𝑎 7 𝑥 7 Addition operations 𝑓 𝑥 ≔ 𝑎 0 + 𝑎 1 𝑥 +⋯ + 𝑎 7 𝑥 7 g 𝑥 ≔ 𝑏 0 + 𝑏 1 𝑥 +⋯ + 𝑏 7 𝑥 7 𝑓+𝑔 𝑥 ≔ 𝑎 1 ⊕ 𝑏 1 +⋯+ 𝑎 7 ⊕ 𝑏 7 𝑥 7

Finite Fields for 2 8 (carryless multiplication) 𝑔(𝑥) = 𝑥+1 𝑥+1 × 𝑥+1 = 𝑥 𝑥+1 ⊕ 𝑥+1 = (𝑥 2 +𝑥)⊕(𝑥+1)= 𝑥 2 +1 Difference 𝑥+1 × 𝑥+1 = 𝑥+1→5 3 ∗3=9

Irreducible polynomial A polynomial 𝑝 is irreducible if there exists no polynomials 𝑞,𝑟 such that 𝑝 = 𝑞× 𝑟 For every polynomial p,q where p>q, there exists polynomial 𝑟,𝑤 such that p=qr+w 𝑝 𝑚𝑜𝑑 𝑞≔𝑤

Field 256 (used for AES, MACS, etc) ℎ 𝑥 ≔ 𝑥 8 + 𝑥 4 + 𝑥 3 +𝑥+1 S ≔ polynomials 𝑎 0 + 𝑎 1 𝑥 +⋯ + 𝑎 7 𝑥 7 𝑎 𝑗 ∈ {0,1} Addition 𝑓 𝑥 ≔ 𝑎 0 + 𝑎 1 𝑥 +⋯ + 𝑎 7 𝑥 7 g 𝑥 ≔ 𝑏 0 + 𝑏 1 𝑥 +⋯ + 𝑏 7 𝑥 7 𝑓+𝑔 𝑥 ≔ 𝑎 1 ⊕ 𝑏 1 +⋯+ 𝑎 7 ⊕ 𝑏 7 𝑥 7 Multiplication 𝑓⊗𝑔 𝑥 ≔𝑓 𝑥 ×𝑔 𝑥 𝑚𝑜𝑑 ℎ(𝑥) where times denotes carry less multiplication