SlideShare a Scribd company logo
1 of 16
Download to read offline
Mathematics of Cryptography
Integer Arithmetic
Set of Integers
The set of integers, denoted by Z, contains all integral
numbers (with no fraction) from negative infinity to
positive infinity.
Binary Operations
In cryptography, we are interested in three binary
operations applied to the set of integers. A binary
operation takes two inputs and creates one output.
The following shows the results of the three binary operations
on two integers. Because each input can be either positive or
negative, we can have four cases for each operation.
Integer Division
In integer arithmetic, if we divide a by n, we can get q
And r . The relationship between these four integers can
be shown as
a = q × n + r
Assume that a = 255 and n = 11. We can find q = 23 and R = 2
using the division algorithm.
Division algorithm for integers
When we use a computer or a calculator, r and q are negative
when a is negative. How can we apply the restriction that r
needs to be positive? The solution is simple, we decrement the
value of q by 1 and we add the value of n to r to make it positive.
Note
Fact 1: The integer 1 has only one divisor, itself.
Fact 2: Any positive integer has at least two divisors, 1 and itself
(but it can have more).
Note
Greatest Common Divisor
The greatest common divisor of two positive integers is the largest
integer that can divide both integers.
Euclidean Algorithm
Fact 1: gcd (a, 0) = a
Fact 2: gcd (a, b) = gcd (b, r),
where r is the remainder of dividing a by b
Euclidean Algorithm
NB: When gcd (a, b) = 1, we say that a and b are
relatively prime.
Using Euclidean Algorithm
Find the greatest common divisor of 2740 and 1760.
Solution: We have gcd (2740, 1760) = 20.
q r1 r2 r
1 2740 1760 980
1 1760 980 780
1 980 780 200
3 780 200 180
1 200 180 20
9 180 20 0
20 0
Extended Euclidean Algorithm
Given two integers a and b, we often need to find other two
integers, s and t, such that
The extended Euclidean algorithm can calculate the gcd (a, b)
and at the same time calculate the value of s and t.
Extended Euclidean algorithm
Extended Euclidean algorithm
1
Example
q r1 r2 r s1 s2 s t1 t2 t
5 161 28 21 1 0 1 0 1 -5
1 28 21 7 0 1 -1 1 -5 6
3 21 7 0 1 -1 4 -5 6 -23
7 0 -1 4 6 -23
Given a = 161 and b = 28, find gcd (a, b) and the values of s and t.
Solution: We get gcd (161, 28) = 7, s = −1 and t = 6.
1

More Related Content

Similar to Lec_2.pdf

Crypto cs36 39
Crypto cs36 39Crypto cs36 39
Crypto cs36 39sravanbabu
 
Complete ncert exemplar class 10
Complete ncert exemplar class 10Complete ncert exemplar class 10
Complete ncert exemplar class 10physicsmaths5
 
1.02.Mathematical_background.pptx
1.02.Mathematical_background.pptx1.02.Mathematical_background.pptx
1.02.Mathematical_background.pptxPrachiDawer1
 
An Introduction to Elleptic Curve Cryptography
An Introduction to Elleptic Curve CryptographyAn Introduction to Elleptic Curve Cryptography
An Introduction to Elleptic Curve CryptographyDerek Callaway
 
NumberTheory explanations in the easiest way.ppt
NumberTheory explanations in the easiest way.pptNumberTheory explanations in the easiest way.ppt
NumberTheory explanations in the easiest way.pptIshwariKhanal
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyappasami
 
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |Slides With MANAV
 
Is unit 4_number_theory
Is unit 4_number_theoryIs unit 4_number_theory
Is unit 4_number_theorySarthak Patel
 
Chapter 2 Lecture Notes_ Divisibility.pdf
Chapter 2 Lecture Notes_ Divisibility.pdfChapter 2 Lecture Notes_ Divisibility.pdf
Chapter 2 Lecture Notes_ Divisibility.pdfgeorgianabeauty02
 
Review of Trigonometry for Calculus “Trigon” =triangle +“metry”=measurement =...
Review of Trigonometry for Calculus “Trigon” =triangle +“metry”=measurement =...Review of Trigonometry for Calculus “Trigon” =triangle +“metry”=measurement =...
Review of Trigonometry for Calculus “Trigon” =triangle +“metry”=measurement =...KyungKoh2
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notationsajinis3
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and ComplexityRajandeep Gill
 
Design and analysis of algorithm ppt ppt
Design and analysis of algorithm ppt pptDesign and analysis of algorithm ppt ppt
Design and analysis of algorithm ppt pptsrushtiivp
 
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisAmrinder Arora
 
NumberTheory.ppt
NumberTheory.pptNumberTheory.ppt
NumberTheory.pptDhandhan16
 
GCD of n Numbers
GCD of n NumbersGCD of n Numbers
GCD of n NumbersSaikat Roy
 

Similar to Lec_2.pdf (20)

Crypto cs36 39
Crypto cs36 39Crypto cs36 39
Crypto cs36 39
 
Complete ncert exemplar class 10
Complete ncert exemplar class 10Complete ncert exemplar class 10
Complete ncert exemplar class 10
 
1.02.Mathematical_background.pptx
1.02.Mathematical_background.pptx1.02.Mathematical_background.pptx
1.02.Mathematical_background.pptx
 
An Introduction to Elleptic Curve Cryptography
An Introduction to Elleptic Curve CryptographyAn Introduction to Elleptic Curve Cryptography
An Introduction to Elleptic Curve Cryptography
 
NumberTheory explanations in the easiest way.ppt
NumberTheory explanations in the easiest way.pptNumberTheory explanations in the easiest way.ppt
NumberTheory explanations in the easiest way.ppt
 
integrated algebra.pptx
integrated algebra.pptxintegrated algebra.pptx
integrated algebra.pptx
 
4
44
4
 
Cs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer keyCs6402 design and analysis of algorithms may june 2016 answer key
Cs6402 design and analysis of algorithms may june 2016 answer key
 
Complex numbers
Complex numbersComplex numbers
Complex numbers
 
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
Ncert Maths Class-X | Chapter-1 | Slides By MANAV |
 
Is unit 4_number_theory
Is unit 4_number_theoryIs unit 4_number_theory
Is unit 4_number_theory
 
Chapter 2 Lecture Notes_ Divisibility.pdf
Chapter 2 Lecture Notes_ Divisibility.pdfChapter 2 Lecture Notes_ Divisibility.pdf
Chapter 2 Lecture Notes_ Divisibility.pdf
 
Review of Trigonometry for Calculus “Trigon” =triangle +“metry”=measurement =...
Review of Trigonometry for Calculus “Trigon” =triangle +“metry”=measurement =...Review of Trigonometry for Calculus “Trigon” =triangle +“metry”=measurement =...
Review of Trigonometry for Calculus “Trigon” =triangle +“metry”=measurement =...
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
Design and analysis of algorithm ppt ppt
Design and analysis of algorithm ppt pptDesign and analysis of algorithm ppt ppt
Design and analysis of algorithm ppt ppt
 
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity AnalysisEuclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
Euclid's Algorithm for Greatest Common Divisor - Time Complexity Analysis
 
NumberTheory.ppt
NumberTheory.pptNumberTheory.ppt
NumberTheory.ppt
 
main
mainmain
main
 
GCD of n Numbers
GCD of n NumbersGCD of n Numbers
GCD of n Numbers
 

More from Mattupallipardhu (13)

Module 1.pptx
Module 1.pptxModule 1.pptx
Module 1.pptx
 
Image processing.pptx
Image processing.pptxImage processing.pptx
Image processing.pptx
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
Lec_10.pdf
Lec_10.pdfLec_10.pdf
Lec_10.pdf
 
Lec_4.pdf
Lec_4.pdfLec_4.pdf
Lec_4.pdf
 
2-D Transformations.pdf
2-D Transformations.pdf2-D Transformations.pdf
2-D Transformations.pdf
 
Ray Tracing.pdf
Ray Tracing.pdfRay Tracing.pdf
Ray Tracing.pdf
 
Fundamentals of Computer Graphics.pdf
Fundamentals of Computer Graphics.pdfFundamentals of Computer Graphics.pdf
Fundamentals of Computer Graphics.pdf
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Hidden_surfaces.pdf
Hidden_surfaces.pdfHidden_surfaces.pdf
Hidden_surfaces.pdf
 
cathoderaytube.pdf
cathoderaytube.pdfcathoderaytube.pdf
cathoderaytube.pdf
 
2d Transformation.pdf
2d Transformation.pdf2d Transformation.pdf
2d Transformation.pdf
 
3. Syntax Analyzer.pptx
3. Syntax Analyzer.pptx3. Syntax Analyzer.pptx
3. Syntax Analyzer.pptx
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Lec_2.pdf

  • 2. Set of Integers The set of integers, denoted by Z, contains all integral numbers (with no fraction) from negative infinity to positive infinity.
  • 3. Binary Operations In cryptography, we are interested in three binary operations applied to the set of integers. A binary operation takes two inputs and creates one output.
  • 4. The following shows the results of the three binary operations on two integers. Because each input can be either positive or negative, we can have four cases for each operation.
  • 5. Integer Division In integer arithmetic, if we divide a by n, we can get q And r . The relationship between these four integers can be shown as a = q × n + r
  • 6. Assume that a = 255 and n = 11. We can find q = 23 and R = 2 using the division algorithm.
  • 8. When we use a computer or a calculator, r and q are negative when a is negative. How can we apply the restriction that r needs to be positive? The solution is simple, we decrement the value of q by 1 and we add the value of n to r to make it positive.
  • 9. Note Fact 1: The integer 1 has only one divisor, itself. Fact 2: Any positive integer has at least two divisors, 1 and itself (but it can have more).
  • 10. Note Greatest Common Divisor The greatest common divisor of two positive integers is the largest integer that can divide both integers. Euclidean Algorithm Fact 1: gcd (a, 0) = a Fact 2: gcd (a, b) = gcd (b, r), where r is the remainder of dividing a by b
  • 11. Euclidean Algorithm NB: When gcd (a, b) = 1, we say that a and b are relatively prime.
  • 12. Using Euclidean Algorithm Find the greatest common divisor of 2740 and 1760. Solution: We have gcd (2740, 1760) = 20. q r1 r2 r 1 2740 1760 980 1 1760 980 780 1 980 780 200 3 780 200 180 1 200 180 20 9 180 20 0 20 0
  • 13. Extended Euclidean Algorithm Given two integers a and b, we often need to find other two integers, s and t, such that The extended Euclidean algorithm can calculate the gcd (a, b) and at the same time calculate the value of s and t.
  • 16. Example q r1 r2 r s1 s2 s t1 t2 t 5 161 28 21 1 0 1 0 1 -5 1 28 21 7 0 1 -1 1 -5 6 3 21 7 0 1 -1 4 -5 6 -23 7 0 -1 4 6 -23 Given a = 161 and b = 28, find gcd (a, b) and the values of s and t. Solution: We get gcd (161, 28) = 7, s = −1 and t = 6. 1