NET 311D INFORMATION SECURITY

Similar documents
Public Key Cryptography

Chapter 8 Public-key Cryptography and Digital Signatures

Review. CS311H: Discrete Mathematics. Number Theory. Computing GCDs. Insight Behind Euclid s Algorithm. Using this Theorem. Euclidian Algorithm

Number Theory & Modern Cryptography

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

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

Integers and Division

Discrete Mathematics GCD, LCM, RSA Algorithm

Cryptography. P. Danziger. Transmit...Bob...

RSA ENCRYPTION USING THREE MERSENNE PRIMES

Implementation Tutorial on RSA

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

The RSA cryptosystem and primality tests

Encryption: The RSA Public Key Cipher

Public Key Algorithms

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

Mathematics of Cryptography

CIS 551 / TCOM 401 Computer and Network Security

Introduction to Modern Cryptography. Benny Chor

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems

CRYPTOGRAPHY AND NUMBER THEORY

An Introduction to Cryptography

Introduction. What is RSA. A Guide To RSA by Robert Yates. Topics

Real scripts backgrounder 3 - Polyalphabetic encipherment - XOR as a cipher - RSA algorithm. David Morgan

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

Implementation of the RSA algorithm and its cryptanalysis. Abstract. Introduction

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION

Ti Secured communications

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

Chapter 11 : Private-Key Encryption

Ma/CS 6a Class 3: The RSA Algorithm

The security of RSA (part 1) The security of RSA (part 1)

basics of security/cryptography

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography

ECE 646 Lecture 5. Motivation: Mathematical Background: Modular Arithmetic. Public-key ciphers. RSA keys. RSA as a trap-door one-way function

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

2. Cryptography 2.5. ElGamal cryptosystems and Discrete logarithms

Math 412: Number Theory Lecture 13 Applications of

RSA. Ramki Thurimella

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

MATHEMATICS EXTENDED ESSAY

Number theory (Chapter 4)

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

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

Public Key Cryptography

Mathematical Foundations of Public-Key Cryptography

COMP424 Computer Security

10 Modular Arithmetic and Cryptography

Introduction to Number Theory. The study of the integers

Theme : Cryptography. Instructor : Prof. C Pandu Rangan. Speaker : Arun Moorthy CS

W3203 Discrete Mathema1cs. Number Theory. Spring 2015 Instructor: Ilia Vovsha. hcp://

Public-Key Encryption: ElGamal, RSA, Rabin

Introduction to Cybersecurity Cryptography (Part 4)

CS483 Design and Analysis of Algorithms

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

Homework 4 for Modular Arithmetic: The RSA Cipher

University of Tokyo: Advanced Algorithms Summer Lecture 6 27 May. Let s keep in mind definitions from the previous lecture:

ICS141: Discrete Mathematics for Computer Science I

Introduction to Cybersecurity Cryptography (Part 4)

RSA-256bit 數位電路實驗 TA: 吳柏辰. Author: Trumen

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

Week 7 An Application to Cryptography

Ma/CS 6a Class 1. Course Details

Cryptography CS 555. Topic 24: Finding Prime Numbers, RSA

ECE596C: Handout #11

Cryptography. pieces from work by Gordon Royle

Iterated Encryption and Wiener s attack on RSA

Candidates must show on each answer book the type of calculator used. Only calculators permitted under UEA Regulations may be used.

Cryptography IV: Asymmetric Ciphers

Congruence of Integers

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

Number Theory Notes Spring 2011

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

Math.3336: Discrete Mathematics. Mathematical Induction

A New Attack on RSA with Two or Three Decryption Exponents

Introduction to Public-Key Cryptosystems:

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

Cryptography CS 555. Topic 18: RSA Implementation and Security. CS555 Topic 18 1

Jong C. Park Computer Science Division, KAIST

19. Coding for Secrecy

dit-upm RSA Cybersecurity Cryptography

Gurgen Khachatrian Martun Karapetyan

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks

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).

Quantum Cryptography. Marshall Roth March 9, 2007

RSA Algorithm. Factoring, EulerPhi, Breaking RSA. Çetin Kaya Koç Spring / 14

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

NUMBER THEORY FOR CRYPTOGRAPHY

Number Theory and Group Theoryfor Public-Key Cryptography

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

Notes 10: Public-key cryptography

Powers in Modular Arithmetic, and RSA Public Key Cryptography

Lecture Notes, Week 6

Elliptic Curve Cryptography

DM49-2. Obligatoriske Opgave

Shift Cipher. For 0 i 25, the ith plaintext character is. E.g. k = 3

10 Public Key Cryptography : RSA

Ma/CS 6a Class 4: Primality Testing

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

Transcription:

1 NET 311D INFORMATION SECURITY Networks and Communication Department TUTORIAL 3 : Asymmetric Ciphers (RSA)

A Symmetric-Key Cryptography (Public-Key Cryptography) Asymmetric-key (public key cryptography) uses two keys: one private and one public. There are two algorithms: RSA ELGAMAL

RSA The most common public key algorithm is RSA, named for its inventors Rivest, Shamir, and Adelman. It uses two numbers: e public key d private

RSA Step 1:selecting keys 1. Choose two very large prime numbers p and q 2. Find n n=p x q 3. Calculates another number ф = (p -1) X (q -1) 4. Choose random encryption number e, 1< e< ф gcd(e, ф)=1 (coprime) (You can use Euclidian algorithm to help you find correct e) 5. Calculate d so that d X e mod ф = 1 (using table method) Note : Announce e and n to the public; keep ф and d secret.

RSA Step 2: Encryption (Sender) Where P : plain text n= pxq C : cipher text e: public key Restriction P < n, if not, the plaintext needs to be divided into blocks to make P less than n.

RSA Step 3: Decryption (Receiver) Where P : plain text n= pxq C : cipher text d: private key

RSA: Example 1 Perform encryption and decryption using the RSA algorithm, for the following: p = 3; q = 11, e = 7; M = 5

RSA Step 1:selecting keys 1. p=3 ; q =11 2. n=p x q = 3 x 11 =33 n=33 3. ф = (p -1) X (q -1) = (3-1) x (11-1)= 2 x10 = 20 ф = 20 4. e (which is mentioned in question ) e=7 1< e< ф gcd(e, ф)=1 (coprime) (You can use Euclidian algorithm to help you find correct e) 5. Calculate d so that d X e mod ф = 1 (using table method) Note : Announce e and n to the public; keep ф and d secret.

Euclidian algorithm 2 7 20 14 6 1 7 6 1 1. Divide the ф by e 1 6 6 0 STOP 2. Divide the divisor of the previous division by the reminder of the previous division 3. Repeat step 2 until the reminder become 0

Euclidian algorithm cont. Rewrite the previous operations as the following: Dividend= (divisor x quotient )+ Reminder 20=(7 x 2) + 6 7= (6 x 1) + 1 6=(6 x 1) +0 This is the gcd(20,7)

Table method Row # a b c g 1 1 0 20-2 0 1 7 2 1. As default in all situations, put the values of a 1 and b 0 in 1 st row and the values of a 0 and b 1in 2 nd row 2. 1 st row : c= ф and g= empty 3. 2 nd row : c= e and g= (c1 /c2) (take only the integer part) (20/7)=2.8 2

Table method cont. Row # a b c g 1 1 0 20-2 0 1 7 2 3 1-2 6 1 3. 3 rd row: In row n column n = column n 2 column n 1 x g n 1 except g n = c n 1 / c n (take only the integer part) a3= a1-a2*g2 1-0*2=1 b3= b1-b2*g2 0-1*2=-2 c3= c1-c2*g2 20-7*2=6 ( it s the reminder of 20/7) g3= (c2 /c3) (take only the integer part) (7/6)=1.16 1

Table method cont. Row # a b c g 1 1 0 20-2 0 1 7 2 3 1-2 6 1 4-1 3 1 6 4. 4 th row: In row n column n = column n 2 column n 1 x g n 1 except g n = c n 1 / c n (take only the integer part) a4= a2-a3*g3 0-1*1=-1 b4= b2-b3*g3 1-(-2)*1=3 c4= c2-c3*g3 7-6*1=1 ( it s the reminder of 7/6) g4= (c3 /c4) (take only the integer part) (6/1)=6

Table method cont. Row # a b c g 1 1 0 20-2 0 1 7 2 3 1-2 6 1 4-1 3 1 6 Stop when the value of c become 1 Then the latest value of b is the value of d d=3 Important notes : 1. If the value of b is negative d= ф + b 2. If the value of b> ф d= b mod ф To confirm your answer: a*ф + b*e = gcd (ф,e) In our example : -20 + 21 = 1 1=1 it s correct

RSA Step 1:selecting keys 1. p=3 ; q =11 2. n=33 3. ф = 20 4. e=7 5. d=3 Note : Announce e and n to the public; keep ф and d secret.

RSA Step 2: Encryption (Sender) P=M= 5, e=7,n=33 C = 5 7 mod (33) C = [(5 4 mod 33) * (5 2 mod 33) * (5 1 mod 33)] mod 33 C = (31 * 25 * 5) mod 33 C = 3875 mod 33 C=14

RSA Step 3: Decryption (Receiver) C=14, d=3,n=33 P=14 3 mod 33 P = [(14 2 mod 33)*(14 1 mod 33)] mod 33 P= 434 mod 33 P=5

RSA: Example 2 Encrypt the following message YES By Using RSA algorithm. Assume that p=5, q =11, e= 3 Each character will be encoded according to this algorithm (A - Z) (00 25) Find d, then encrypt each character individually

RSA Step 1:selecting keys 1. p=5 ; q =11 2. n=p x q = 5 x 11 =55 55 3. ф = (p -1) X (q -1) = (5-1) x (11-1)= 4 x10 = 40 ф = 40 4. e (which is mentioned in question ) e=3 1< e< ф gcd(e, ф)=1 (coprime) (You can use Euclidian algorithm to help you find correct e) 5. Calculate d so that d X e mod ф = 1 (using table method) Note : Announce e and n to the public; keep ф and d secret.

Euclidian algorithm 13 3 40 39 1 3 3 3 0 STOP 1. Divide the ф by e 2. Divide the divisor of the previous division by the reminder of the previous division 3. Repeat step 2 until the reminder become 0

Euclidian algorithm cont. Rewrite the previous operations as the following: Dividend= (divisor x quotient )+ Reminder 40=(13x 3) + 1 3= (3 x 1) + 0 This is the gcd(40,3)

Table method Row # a b c g 1 1 0 40-2 0 1 3 13 1. As default in all situations, put the values of a 1 and b 0 in 1 st row and the values of a 0 and b 1in 2 nd row 2. 1 st row : c= ф and g= empty 3. 2 nd row : c= e and g= (c1 /c2) (take only the integer part) (40/3)=13.3 13

Table method cont. Row # a b c g 1 1 0 40-2 0 1 3 13 3 1-13 1 3 3. 3 rd row: In row n column n = column n 2 column n 1 x g n 1 except g n = c n 1 / c n (take only the integer part) a3= a1-a2*g2 1-0*13=1 b3= b1-b2*g2 0-1*13=-13 c3= c1-c2*g2 40-3*13=1 ( it s the reminder of 40/3) g3= (c2 /c3) (take only the integer part) (3/1)=3

Table method cont. Row # a b c g 1 1 0 40-2 0 1 3 13 3 1-13 1 3 Stop when the value of c become 1 Then the latest value of b is the value of d b= -13 (It s negative ) Based on note 1 d= ф+b 40+(-13)= 27 d= 27 Important notes : 1. If the value of b is negative d= ф + b 2. If the value of b> ф d= b mod ф To confirm your answer: a*ф + b*e = gcd (ф,e) In our example : 40+ (-39) = 1 1=1 it s correct

RSA Step 1:selecting keys 1. p=5 ; q =11 2. n=55 3. ф = 40 4. e=3 5. d=27 Note : Announce e and n to the public; keep ф and d secret.

RSA Step 2: Encryption (Sender) P=M=YES(must be encoded before), e=3,n=55 Y=24 S=18 C = 24 3 mod (55) C = 18 3 mod (55) C= 19 C= 2 E=4 C = 4 3 mod (55) C= 9

RSA Step 2: Encryption (Sender) cont. 27 24-Feb-15

RSA Step 3: Decryption (Receiver) C=19 P = 19 27 mod (55) P= 24 C=9 P = 9 27 mod (55) P= 4 C=2 P = 2 27 mod (55) P= 18