Crypto math II. Alin Tomescu May 27, Abstract A quick overview on group theory from Ron Rivest s course in Spring 2015.

Similar documents
Introduction to Cryptography. Lecture 8

Intro to Public Key Cryptography Diffie & Hellman Key Exchange

L7. Diffie-Hellman (Key Exchange) Protocol. Rocky K. C. Chang, 5 March 2015

CIS 6930/4930 Computer and Network Security. Topic 5.2 Public Key Cryptography

Lecture Notes, Week 6

14 Diffie-Hellman Key Agreement

Introduction to Elliptic Curve Cryptography. Anupam Datta

Lecture 1: Introduction to Public key cryptography

Lecture 16: Public Key Encryption:II

2. Cryptography 2.5. ElGamal cryptosystems and Discrete logarithms

CPSC 467b: Cryptography and Computer Security

Discrete Logarithm Problem

Public Key Cryptography. All secret key algorithms & hash algorithms do the same thing but public key algorithms look very different from each other.

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University

Network Security Technology Spring, 2018 Tutorial 3, Week 4 (March 23) Due Date: March 30

Public-Key Cryptosystems CHAPTER 4

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Public Key Cryptography

Chapter 8 Public-key Cryptography and Digital Signatures

Lecture 17: Constructions of Public-Key Encryption

Public Key Algorithms

Elliptic Curve Cryptography

Notes for Lecture 17

Introduction to Modern Cryptography. Benny Chor

CPSC 467b: Cryptography and Computer Security

Practice Assignment 2 Discussion 24/02/ /02/2018

during transmission safeguard information Cryptography: used to CRYPTOGRAPHY BACKGROUND OF THE MATHEMATICAL

Public-Key Cryptography. Lecture 9 Public-Key Encryption Diffie-Hellman Key-Exchange

1 Number Theory Basics

Asymmetric Encryption

Cryptography and RSA. Group (1854, Cayley) Upcoming Interview? Outline. Commutative or Abelian Groups

ASYMMETRIC ENCRYPTION

Lecture 19: Public-key Cryptography (Diffie-Hellman Key Exchange & ElGamal Encryption) Public-key Cryptography

Other Public-Key Cryptosystems

Lecture 11: Key Agreement

Elliptic curves: Theory and Applications. Day 4: The discrete logarithm problem.

Evidence that the Diffie-Hellman Problem is as Hard as Computing Discrete Logs

RSA. Ramki Thurimella

CPSC 467: Cryptography and Computer Security

Fundamentals of Modern Cryptography

ECS 189A Final Cryptography Spring 2011

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

Lecture V : Public Key Cryptography

MATH 158 FINAL EXAM 20 DECEMBER 2016

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

Lecture 17 - Diffie-Hellman key exchange, pairing, Identity-Based Encryption and Forward Security

Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013

Digital Signatures. Saravanan Vijayakumaran Department of Electrical Engineering Indian Institute of Technology Bombay

Chapter 4 Asymmetric Cryptography

Asymmetric Cryptography

Introduction to Modern Cryptography. Benny Chor

Topics in Cryptography. Lecture 5: Basic Number Theory

CPSC 467: Cryptography and Computer Security

Lecture 7: ElGamal and Discrete Logarithms

Cryptography IV: Asymmetric Ciphers

CIS 551 / TCOM 401 Computer and Network Security

Other Public-Key Cryptosystems

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

Public Key 9/17/2018. Symmetric Cryptography Review. Symmetric Cryptography: Shortcomings (1) Symmetric Cryptography: Analogy

CHALMERS GÖTEBORGS UNIVERSITET. TDA352 (Chalmers) - DIT250 (GU) 11 April 2017, 8:30-12:30

Math/Mthe 418/818. Review Questions

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculty of Mathematics and Computer Science Exam Cryptology, Tuesday 30 October 2018

Public-Key Encryption: ElGamal, RSA, Rabin

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

Elliptic Curves. Giulia Mauri. Politecnico di Milano website:

Pseudonym and Anonymous Credential Systems. Kyle Soska 4/13/2016

The odd couple: MQV and HMQV

CRYPTOGRAPHY AND NUMBER THEORY

Introduction to Cryptography. Lecture 6

Lecture 22: RSA Encryption. RSA Encryption

CPSC 467: Cryptography and Computer Security

Lecture 10: Zero-Knowledge Proofs

Lecture 28: Public-key Cryptography. Public-key Cryptography

Question: Total Points: Score:

Elliptic Curves: Theory and Application

CPSC 467b: Cryptography and Computer Security

Lecture 1: Perfect Secrecy and Statistical Authentication. 2 Introduction - Historical vs Modern Cryptography

Cryptography and Security Final Exam

SIGNATURE SCHEMES & CRYPTOGRAPHIC HASH FUNCTIONS. CIS 400/628 Spring 2005 Introduction to Cryptography

Lecture 4 Chiu Yuen Koo Nikolai Yakovenko. 1 Summary. 2 Hybrid Encryption. CMSC 858K Advanced Topics in Cryptography February 5, 2004

RSA RSA public key cryptosystem

10 Public Key Cryptography : RSA

Elliptic Curve Cryptography

Security II: Cryptography exercises

Computational Number Theory. Adam O Neill Based on

Introduction to Cryptography. Susan Hohenberger

My brief introduction to cryptography

An Introduction to Pairings in Cryptography

Introduction to Modern Cryptography. Lecture RSA Public Key CryptoSystem 2. One way Trapdoor Functions

Information Security

Sharing a Secret in Plain Sight. Gregory Quenell

Elliptic Curve Cryptography with Derive

CPSC 467: Cryptography and Computer Security

ENEE 457: Computer Systems Security 10/3/16. Lecture 9 RSA Encryption and Diffie-Helmann Key Exchange

Provable Security for Public-Key Schemes. Outline. I Basics. Secrecy of Communications. Outline. David Pointcheval

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Public Key Cryptography

Introduction to Cybersecurity Cryptography (Part 4)

Digital Signatures. p1.

Lecture 9 Julie Staub Avi Dalal Abheek Anand Gelareh Taban. 1 Introduction. 2 Background. CMSC 858K Advanced Topics in Cryptography February 24, 2004

Transcription:

Crypto math II Alin Tomescu alinush@mit.edu May 7, 015 Abstract A quick overview on group theory from Ron Rivest s 6.857 course in Spring 015. 1 Overview Group theory review Diffie-Hellman (DH) key exchange Five crypto groups: Z p Q p Z n Q n elliptic curves Group theory review Here, we are talking about multiplicative groups (where the operation between group elements is something resembling multiplication) Definition: pg, q is a finite abelian group of size t if: D identity 1 such that @a P G, a 1 1 a a @a P G, Db P G such that a b 1 @a, b, c P G, a pb cq pa bq c @a, b P G, a b b a 1

.1 Order and generators Definition: The order of a in G is denoted by orderpaq and is equal to the least u such that a u 1 Lagrange s Theorem: In a finite abelian group of size t, for all a P G, orderpaq t Theorem: In a finite abelian group of size t, @a P G, a t 1 Example: a pp 1q 1, @a P Z p because Z p 1 Definition: xay ta i : i ě 0u subgroup generated by a. Definition: If xay G then G is cyclic and a is a generator of G. Note: xay orderpaq Exercise: In a finite abelian group G of order t, where t is prime, we have: @a P G, if a 1 ñ a is a generator of G. Solution: We know that the size of any subgroup of G must divide t. Since t is prime, any subgroup can either have size 1 or t. Thus, only trivial subgroups can exist: the subgroup made up of the identity element (t1u) and G itself. Since a 1, any subgroup generated by a cannot be equal to t1u because it will have to contain a itself which is different than 1. Thus, if a generates any subgroup, it has to generate G itself. How do we know that a generates any subgroup at all then? We know a P G ñ a u P G, @u and, informally, we know that there cannot be a u, 1 ă u ă t such that a u 1 because that would create a subgroup of G of size u, which would imply u t, which would be false since t is prime. Theorem: Z p is always cyclic (i.e. there exists a generator within Z p). Discrete logs Theorem: If G is a cyclic group of order t and generator g then the relation x Ø g x is one-to-one between r0, 1,..., t 1s and G. x ÞÑ g x : exponentiation, powering-up g x ÞÑ x : discrete logarithm (DL) Computing discrete logarithms (the DL problem) is commonly assumed to be hard/infeasible for well-chosen groups G (e.g. Z p for p a large randomly chosen prime). In practice, we need to be able to translate bits of data or messages from a message space M to group elements of G. We need an one-to-one (injective) function f : M Ñ G such that fpmq P G can be chosen to represent message m P M. TODO: Does f need to be onto (surjective) as well? Are there cases where we need to reverse f? Example: If we have Z p with p ą k, then we can represent any k-bit message m as a number x P r0, k q because if x P r0, k q, then x P Z p. Note: For some groups, finding an easily-computable, space-efficient f may be a little hard.

.3 API for a group Typically, any library that implements a group should provide the following calls: Operation API call Comments creation G Ð creategroupp... q identity G.identitypq random element x Ð G.randompq product x y or ` inverse x 1 or x power x k, x P G, k P Z or k x size G.orderpq G, not always implemented list G.elementspq not always implemented represent x Ð G.reppmq unrepresent m Ð G.unreppxq generator G.generatorpq discrete log x Ð G.discreteLogpg, yq s.t g x y, not always efficiently possible 3 Diffie-Hellman key exchange (1976) How can we establish a shared secret in the presence of a passive eavesdropper Eve? Let G be a cyclic group with generator g. G and g are fixed and public. Alice and Bob can agree on a shared secret key k as follows: 1. Alice chooses secret x randomly from r0,..., G 1s. Note that x R G.. Alice computes g x as her public key. Note that g x P G and Alice is the only one who knows x, the discrete log of g x. 3. Bob, similarly picks a y and computes g y. 4. Alice and Bob exchange g y and g x. Eve sees them. 5. Assuming discrete logs are hard to compute, Eve cannot learn neither x nor y because she will have a hard time computing the discrete log of g x or g y. 6. Alice computes k pg y q x g xy 7. Bob computes (the same) k pg x q y g xy 8. Alice and Bob have agreed on a shared key k 9. Can Eve compute g xy from g x and g y? We assume she can t and refer to this assumption as the Computational Diffie-Hellman (CDH) assumption. Theorem: CDH is hard ñ Diffie-Hellman key exchange is secure (i.e. Eve does not learn k) Note: Can use k to encrypt and/or MAC messages. 3

Note: If not using an authenticated encryption mode like EAX, derive separate keys for encryption and authentication k enc P RF pk, encq and k mac P RF pk, macq. Note: g x and g y are assumed to be the right public keys for Alice and Bob. What if Eve is active and changes them on their way to Alice and Bob? If Eve is active, she can perform a man-in-the-middle attack: 1. Alice sends g x to Bob, but Eve replaces it with g e, for which she knows e. Eve records g x.. Bob sends g y to Bob, but Eve replaces it with g v, for which she knows v. Eve records g y. 3. Alice got g v from Eve, so she will compute shared key k 1 g xv 4. Bob got g e from Eve, so she will compute shared key k g ye 5. Alice and Bob think they are talking to each other, but they agreed to different keys. 6. Eve can compute k 1 g xv herself: she knows v 7. Eve can compute k g ye herself: she knows e 8. When Alice sends a message to Bob, encrypted and/or MACd with k 1, Eve can decrypt and tamper with the message and then reencrypt and MAC it under k for Bob. 9. Eve can do the same for Bob s messages to Alice. To fix this problem, we need to prevent Eve from swapping Alice and Bob s public keys on the wire. One solution is to have a certification authority (CA) digitally sign g x and g y so that Eve cannot replace them. Note: Still not perfect. What if Eve colludes with the CA? Note: What if Eve has friends with public keys signed by the CA. Those friends can maybe give Eve their private keys and Eve could still pull the attack ñ the digital signature has to cryptographically bind the user s identity (Alice) to her public keys g x. This way, if Eve replaces Alice s public key with her friend s Diana public key, Bob will detect this when he verifies the signature on the public key: the signature will not verify against Alice s name. 4 The five groups 4.1 Z p Definition: Z p ta : 1 ď a ă pu, where p is prime Z p is always cyclic (i.e. has a generator). There are non-constructive proofs for this. If p q ` 1 and q is prime, then p is a safe prime and half of Z p elements are generators and the other half are squares Q p. TODO: Proof? 4

4. Q p, quadratic residues (squares) mod prime p Definition: Q p ta : 1 ď a ă pu Ĺ Z p TODO: Is a ă p or a ă p? Theorem: Q p 1 ˇ ˇ ˇZ p pp 1q Theorem: Q p is cyclic: If xgy Z p, then xg y Q p Thus, Q p tg i : 0 ď i ă p 1 u, if xgy Z p If p q ` 1, then Q p pp 1q q and any element of Q p (other than 1) generates Q p. To find a generator, take the square of any element a P Z p t1, p 1u TODO: Proof for why Z p is split that way? Is p 1 the only generator that would generate a subgroup of size? The identity (i.e. 1) would generate the subgroup of size 1, and apparently all squares generate Q p of size q, which means the rest either generate Z p or the subgroup of size. 4.3 Z n Definition: Z n ta : gcdpa, nq 1, where 1 ď a ă nu Definition: Z n φpnq, the totient function. If n pq where p, q are distinct odd primes, then Z n is not cyclic....but the Chinese Remainder Theorem says there exists an isomorphism from Z n to Z p ˆ Z q. 4.4 Q n, quadratic residues (squares) mod (non-prime) n Definition: Q n ta : 1 ď a ă n, where gcdpa, nq 1u TODO: Is a ă p or a ă p? TODO: Is gcdpa, nq 1 or gcdpa, nq 1? Theorem: If n pq where p r ` 1 and q s ` 1, then Q n rs and Q n is cyclic. 4.5 TODO: Elliptic curves 5