Assignment #3 Solutions January 24, 2006. Practical Aspects of Modern Cryptography Problem #1 Use Fermat’s Little Theorem and induction on k to prove.

Slides:



Advertisements
Similar presentations
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
Advertisements

1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
22C:19 Discrete Structures Integers and Modular Arithmetic
Public Key Encryption Algorithm
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Foundations of Network and Computer Security J J ohn Black Lecture #10 Sep 18 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
Attacks on Digital Signature Algorithm: RSA
1 Cryptosystems Based on Discrete Logarithms. 2 Outline [1] Discrete Logarithm Problem [2] Algorithms for Discrete Logarithm –A trivial algorithm –Shanks’
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
Cryptography & Number Theory
Cryptography1 CPSC 3730 Cryptography Chapter 13 Digital Signature Standard (DSS)
CSE 321 Discrete Structures Winter 2008 Lecture 8 Number Theory: Modular Arithmetic.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
RSA Encryption William Lu. RSA Background  Basic technique first discovered in 1973 by Clifford Cocks of CESG (part of British GCHQ)  Invented in 1977.
CSE 597E Fall 2001 PennState University1 Digital Signature Schemes Presented By: Munaiza Matin.
DSA (Digital Signature Algorithm) Tahani Aljehani.
The RSA Algorithm Rocky K. C. Chang, March
Introduction to Modular Arithmetic and Public Key Cryptography.
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
Great Theoretical Ideas in Computer Science.
CS 627 Elliptic Curves and Cryptography Paper by: Aleksandar Jurisic, Alfred J. Menezes Published: January 1998 Presented by: Sagar Chivate.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
Public-Key Cryptography CS110 Fall Conventional Encryption.
Topic 22: Digital Schemes (2)
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Cryptography and Network Security Chapter 13 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
RSA Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013.
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
Chinese Remainder Theorem Dec 29 Picture from ………………………
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
1 Network and Computer Security (CS 475) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Network and Computer Security (CS 475) Modular Arithmetic
POON TENG HIN.  RSA  Shamir’s Three-Pass Protocol  Other issues.
1 Section Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
Tuesday’s lecture: Today’s lecture: One-way permutations (OWPs)
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine.
Digital Signature Standard (DSS) US Govt approved signature scheme designed by NIST & NSA in early 90's published as FIPS-186 in 1991 revised in 1993,
Introduction to Number Theory Department of Computer Engineering Sharif University of Technology 3/8/2006.
Great Theoretical Ideas in Computer Science.
Foundations of Network and Computer Security J J ohn Black CSCI 6268/TLEN 5550, Spring 2014.
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
Copyright © Zeph Grunschlag, RSA Encryption Zeph Grunschlag.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.
Revision. Cryptography depends on some properties of prime numbers. One of these is that it is rather easy to generate large prime numbers, but much harder.
Practical Aspects of Modern Cryptography
Advanced Algorithms Analysis and Design
RSA Preliminaries.
Foundations of Network and Computer Security
Week #5 – 23/25/27 September 2002 Prof. Marie desJardins
Practical Aspects of Modern Cryptography
Public-key encryption
Applied Symbolic Computation (CS 300) Modular Arithmetic
Systems Architecture I
Practical Aspects of Modern Cryptography
Applied Symbolic Computation (CS 300) Modular Arithmetic
Practical Aspects of Modern Cryptography
Algorithmic Number Theory and Cryptography (CS 303) Modular Arithmetic
Assignment #1 Solutions
Practical Aspects of Modern Cryptography
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Presentation transcript:

Assignment #3 Solutions January 24, 2006

Practical Aspects of Modern Cryptography Problem #1 Use Fermat’s Little Theorem and induction on k to prove that x k(p–1)+1 mod p = x mod p for all primes p and k ≥ 0.

January 24, 2006Practical Aspects of Modern Cryptography Answer #1 By induction on k … Base case k = 0: x k(p–1)+1 mod p = x 0+1 mod p = x mod p Base case k = 1: x k(p–1)+1 mod p = x (p-1)+1 mod p = x p mod p = x mod p (by Fermat’s Little Theorem)

January 24, 2006Practical Aspects of Modern Cryptography Answer #1 (cont.) Inductive step: Assume that x k(p–1)+1 mod p = x mod p. Prove that x (k+1)(p–1)+1 mod p = x mod p.

January 24, 2006Practical Aspects of Modern Cryptography Answer #1 (cont.) x (k+1)(p–1)+1 mod p = x k(p–1)+(p-1)+1 mod p = x k(p–1)+1+(p-1) mod p = x k(p–1)+1 x (p-1) mod p = x x (p-1) mod p (by inductive hypothesis) = x p mod p = x p mod p (by Fermat’s Little Theorem)

January 24, 2006Practical Aspects of Modern Cryptography Problem #2 Show that for distinct primes p and q, x mod p = y mod p x mod q = y mod q together imply that x mod pq = y mod pq.

January 24, 2006Practical Aspects of Modern Cryptography Answer #2 x mod p = y mod p  (x mod p) – (y mod p) = 0  (x – y) mod p = 0 (by first assignment)  (x – y) is a multiple of p. Similarly x mod q = y mod q  (x – y) is a multiple of q.

January 24, 2006Practical Aspects of Modern Cryptography Answer #2 (cont.) Therefore, (x – y) is a multiple of pq  (x – y) mod pq = 0  (x mod pq) – (y mod pq) = 0  x mod pq = y mod pq.

January 24, 2006Practical Aspects of Modern Cryptography Problem #3 Put everything together to prove that x K(p–1)(q-1)+1 mod pq = x mod pq For K ≥ 0 and distinct primes p and q.

January 24, 2006Practical Aspects of Modern Cryptography Answer #3 Let k 1 =K(q–1) and k 2 =K(p–1). x K(p–1)(q-1)+1 mod p = x k 1 (p–1)+1 mod p = x mod p and x K(p–1)(q-1)+1 mod q = x k 1 (q–1)+1 mod q = x mod q By Problem #1, and then by Problem #2 x K(p–1)(q-1)+1 mod pq = x mod pq.

January 24, 2006Practical Aspects of Modern Cryptography Problem #4 E(x) = x 43 mod 143 Find the inverse function D(x) = x d mod 143.

January 24, 2006Practical Aspects of Modern Cryptography Answer #4 143 = 11  13 We need to find d such that 43d mod (11–1)(13–1) = 1. Use the Extended Euclidean Algorithm to find a solution to find x and y such that 120x + 43y = 1.

January 24, 2006Practical Aspects of Modern Cryptography Extended Euclidean Algorithm Given A,B > 0, set x 1 =1, x 2 =0, y 1 =0, y 2 =1, a 1 =A, b 1 =B, i=1. Repeat while b i >0: {i = i + 1; q i = a i-1 div b i-1 ; b i = a i-1 -q i b i-1 ; a i = b i-1 ; x i+1 =x i-1 -q i x i ; y i+1 =y i-1 -q i y i }. For all i: Ax i + By i = a i. Final a i = gcd(A,B).

January 24, 2006Practical Aspects of Modern Cryptography Answer #4 (cont.) iaiai bibi xixi yiyi qiqi

January 24, 2006Practical Aspects of Modern Cryptography Answer #4 (cont.) iaiai bibi xixi yiyi qiqi

January 24, 2006Practical Aspects of Modern Cryptography Answer #4 (cont.) iaiai bibi xixi yiyi qiqi

January 24, 2006Practical Aspects of Modern Cryptography Answer #4 (cont.) iaiai bibi xixi yiyi qiqi

January 24, 2006Practical Aspects of Modern Cryptography Answer #4 (cont.) iaiai bibi xixi yiyi qiqi

January 24, 2006Practical Aspects of Modern Cryptography Answer #4 (cont.) iaiai bibi xixi yiyi qiqi

January 24, 2006Practical Aspects of Modern Cryptography Answer #4 (cont.) iaiai bibi xixi yiyi qiqi

January 24, 2006Practical Aspects of Modern Cryptography Problem #5 Digital Signature Algorithm Public parameters: q = 11, p = 67, g = 9, y = 62 Private secret: x = 4 Message to be signed: M = 8 Selected random parameter: k = 2

January 24, 2006Practical Aspects of Modern Cryptography The Digital Signature Algorithm To sign a 160-bit message M, Generate a random integer k with 0 < k < q, Compute r = (g k mod p) mod q, Compute s = ((M+xr)/k) mod q. The pair (r,s) is the signature on M.

January 24, 2006Practical Aspects of Modern Cryptography Answer #5 r = (g k mod p) mod q = (9 2 mod 67) mod 11 = (81 mod 67) mod 11 = 14 mod 11 = 3 s = ((M+xr)/k) mod q = ((8+4  3)/2) mod 11 = (20/2) mod 11 = 10 mod 11 = 10 The pair (3,10) is the signature on 8.

January 24, 2006Practical Aspects of Modern Cryptography The Digital Signature Algorithm A signature (r,s) on M is verified as follows: Compute w = 1/s mod q, Compute a = wM mod q, Compute b = wr mod q, Compute v = (g a y b mod p) mod q. Accept the signature only if v = r.

January 24, 2006Practical Aspects of Modern Cryptography Answer #5 (cont.) w = 1/s mod q = 1/10 mod 11 = 10 a = wM mod q = 10  8 mod 11 = 3 b = wr mod q = 10  3 mod 11 = 8 v = (9 3  62 8 mod 67) mod 11 = (59  15 mod 67) mod 11 = 14 mod 11 = 3 v = 3 and r = 3 so the signature is validated.