SlideShare a Scribd company logo
1 of 20
FERMAT AND
EULER THEOREM
~ S. Janani, AP/CSE
KCET
Contents
• Fermats Theorem
• Proof
• Eulers Totient Function
• Eulers Theorem
• Proof
• Applications
• Example
Fermats Theorem


Proof
 Consider a set of positive integers less than ‘p’ :
• {1,2,3,…..,(p-1)} and multiply each element by ‘a’ and
‘modulo p’ , to get the set
• X = {a mod p, 2a mod p,…, (p-1)a mod p}
 No elements of X is zero and equal, since p doesn’t
divide a.
 Multiplying the numbers in both sets (p and X) and
taking the result mod p yields
Proof (Contd.,)
• Multiplying the numbers in both sets (p and X) and taking
the result mod p yields
• a * 2a *…* (p-1)a  [1 * 2 * 3 *…* (p-1)] (mod p)
• a p  1
( p  1 ) !  ( p  1) ! ( mod p)
• Thus on equating (p-1)! term from both the sides, since it
is relatively prime to p, result becomes,
An alternative form of Fermat’s Theorem is given as
 1 ( m o d p)
a p
 a ( m o d p )
a p  1
EULER TOTIENT FUNCTION : φ (n)
  (n) : How many numbers there are between 1 and n-
1 that are relatively prime to n.
  (4) = 2 (1, 3 are relatively prime to 4).
  (5) = 4 (1, 2, 3, 4 are relatively prime to 5).
  (6) = 2 (1, 5 are relatively prime to 6).
  (7) = 6 (1, 2, 3, 4, 5, 6 are relatively prime to 7).
EULER TOTIENT FUNCTION : φ (n)
 From  (5) and  (7), (n) will be n-1
whenever n is a prime number.
 This implies that  (n) will be easy to calculate when n
has exactly two different prime factors:
(P * Q) = (P-1)*(Q-1)
if P and Q are prime.
Eulers Theorem
a n  1mod n
Above equation is true if n is prime because then,
and Fermat’s theorem holds.
Consider the set of such integers, labeled as,
Here each element xi of R is unique positive integer less than n
with GCD( xi ,n ) = 1.
n  ( n 1)
Proof
• Multiply each element by a, modulo n :
The set S is permutation of R :
• Because a and xi is relatively prime to n, so multiplication
is also be relatively prime to n. Thus the elements of S are
integers that are less than n and that are relatively prime
to n.
• There are no duplicates in S.
Proof
Applications
Example
• Solve 3 ^ 21 mod 11
Quiz
• Who am I
• I can scramble the text
• One key is not enough for me
• Its more secure if you exploit me
Asymmetric Key Encryption / Public key
encryption
• Who am I
• I was designed by 3 people
• Fermats theorem is my basis
• I can perform encryption
• I need more than one key for my operation
RSA Algorithm
Quiz
• Who am I
• I was designed by 2 people
• One key is not enough for me to do my operation
• Discrete Logarithm is my basis
• I am just used to share the personal data
• I can’t hold the identity
Diffie Hellman Key Exchange Algorithm
Quiz

More Related Content

What's hot

What's hot (20)

Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
 
Elliptic curve cryptography
Elliptic curve cryptographyElliptic curve cryptography
Elliptic curve cryptography
 
Asymmetric Cryptography.pptx
Asymmetric Cryptography.pptxAsymmetric Cryptography.pptx
Asymmetric Cryptography.pptx
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
Number Theory In Cryptography
Number Theory In CryptographyNumber Theory In Cryptography
Number Theory In Cryptography
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption Standard
 
RSA algorithm
RSA algorithmRSA algorithm
RSA algorithm
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Encryption algorithms
Encryption algorithmsEncryption algorithms
Encryption algorithms
 
MD5
MD5MD5
MD5
 
Daa notes 3
Daa notes 3Daa notes 3
Daa notes 3
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
String matching algorithm
String matching algorithmString matching algorithm
String matching algorithm
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Substitution techniques
Substitution techniquesSubstitution techniques
Substitution techniques
 
The MD5 hashing algorithm
The MD5 hashing algorithmThe MD5 hashing algorithm
The MD5 hashing algorithm
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
Network security cryptography ppt
Network security cryptography pptNetwork security cryptography ppt
Network security cryptography ppt
 

Similar to Fermat and euler theorem

Similar to Fermat and euler theorem (20)

FermatThm.pptx
FermatThm.pptxFermatThm.pptx
FermatThm.pptx
 
Arithmetic sequence in elementary and HS
Arithmetic sequence in elementary and HSArithmetic sequence in elementary and HS
Arithmetic sequence in elementary and HS
 
Ch08
Ch08Ch08
Ch08
 
Discrete Math Ch5 counting + proofs
Discrete Math Ch5 counting + proofsDiscrete Math Ch5 counting + proofs
Discrete Math Ch5 counting + proofs
 
Eulers totient
Eulers totientEulers totient
Eulers totient
 
Sequences
SequencesSequences
Sequences
 
Discrete probability
Discrete probabilityDiscrete probability
Discrete probability
 
Counting Theroy .pptx
Counting Theroy .pptxCounting Theroy .pptx
Counting Theroy .pptx
 
Mathematical induction by Animesh Sarkar
Mathematical induction by Animesh SarkarMathematical induction by Animesh Sarkar
Mathematical induction by Animesh Sarkar
 
Logic
LogicLogic
Logic
 
ppt02.ppt
ppt02.pptppt02.ppt
ppt02.ppt
 
6e-ch4.ppt
6e-ch4.ppt6e-ch4.ppt
6e-ch4.ppt
 
X12bPigeonHole.ppt
X12bPigeonHole.pptX12bPigeonHole.ppt
X12bPigeonHole.ppt
 
RSA final notation change2
RSA final notation change2RSA final notation change2
RSA final notation change2
 
04
0404
04
 
A Proof of Twin primes and Golbach's Conjecture
A Proof of Twin primes and Golbach's ConjectureA Proof of Twin primes and Golbach's Conjecture
A Proof of Twin primes and Golbach's Conjecture
 
Number theory
Number theoryNumber theory
Number theory
 
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
 
file_5.pptx
file_5.pptxfile_5.pptx
file_5.pptx
 
Sequence and Series
Sequence and SeriesSequence and Series
Sequence and Series
 

More from Janani S

Career Domain 2022-23.pptx
Career Domain 2022-23.pptxCareer Domain 2022-23.pptx
Career Domain 2022-23.pptxJanani S
 
Ethical Hacking and Network Defence 1.pptx
Ethical Hacking and Network Defence 1.pptxEthical Hacking and Network Defence 1.pptx
Ethical Hacking and Network Defence 1.pptxJanani S
 
Joy of Programming
Joy of ProgrammingJoy of Programming
Joy of ProgrammingJanani S
 
Getting QWERTYfied
Getting QWERTYfiedGetting QWERTYfied
Getting QWERTYfiedJanani S
 
Information theory
Information theoryInformation theory
Information theoryJanani S
 
Euclid algorithm and congruence matrix
Euclid algorithm and congruence matrixEuclid algorithm and congruence matrix
Euclid algorithm and congruence matrixJanani S
 
Modular arithmetic
Modular arithmeticModular arithmetic
Modular arithmeticJanani S
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniquesJanani S
 
Cool Coding
Cool CodingCool Coding
Cool CodingJanani S
 
Multicore and shared multi processor
Multicore and shared multi processorMulticore and shared multi processor
Multicore and shared multi processorJanani S
 
Kf sensor1
Kf sensor1Kf sensor1
Kf sensor1Janani S
 
Digital signature
Digital signatureDigital signature
Digital signatureJanani S
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemJanani S
 
Peer to peer services
Peer to peer servicesPeer to peer services
Peer to peer servicesJanani S
 

More from Janani S (15)

Career Domain 2022-23.pptx
Career Domain 2022-23.pptxCareer Domain 2022-23.pptx
Career Domain 2022-23.pptx
 
Ethical Hacking and Network Defence 1.pptx
Ethical Hacking and Network Defence 1.pptxEthical Hacking and Network Defence 1.pptx
Ethical Hacking and Network Defence 1.pptx
 
Joy of Programming
Joy of ProgrammingJoy of Programming
Joy of Programming
 
Getting QWERTYfied
Getting QWERTYfiedGetting QWERTYfied
Getting QWERTYfied
 
Information theory
Information theoryInformation theory
Information theory
 
Euclid algorithm and congruence matrix
Euclid algorithm and congruence matrixEuclid algorithm and congruence matrix
Euclid algorithm and congruence matrix
 
Modular arithmetic
Modular arithmeticModular arithmetic
Modular arithmetic
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
Cool Coding
Cool CodingCool Coding
Cool Coding
 
Unit iii
Unit iiiUnit iii
Unit iii
 
Multicore and shared multi processor
Multicore and shared multi processorMulticore and shared multi processor
Multicore and shared multi processor
 
Kf sensor1
Kf sensor1Kf sensor1
Kf sensor1
 
Digital signature
Digital signatureDigital signature
Digital signature
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Peer to peer services
Peer to peer servicesPeer to peer services
Peer to peer services
 

Recently uploaded

Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
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
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
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
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 

Recently uploaded (20)

Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
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
 
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
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
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
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 

Fermat and euler theorem

  • 1. FERMAT AND EULER THEOREM ~ S. Janani, AP/CSE KCET
  • 2. Contents • Fermats Theorem • Proof • Eulers Totient Function • Eulers Theorem • Proof • Applications • Example
  • 4. Proof  Consider a set of positive integers less than ‘p’ : • {1,2,3,…..,(p-1)} and multiply each element by ‘a’ and ‘modulo p’ , to get the set • X = {a mod p, 2a mod p,…, (p-1)a mod p}  No elements of X is zero and equal, since p doesn’t divide a.  Multiplying the numbers in both sets (p and X) and taking the result mod p yields
  • 5. Proof (Contd.,) • Multiplying the numbers in both sets (p and X) and taking the result mod p yields • a * 2a *…* (p-1)a  [1 * 2 * 3 *…* (p-1)] (mod p) • a p  1 ( p  1 ) !  ( p  1) ! ( mod p) • Thus on equating (p-1)! term from both the sides, since it is relatively prime to p, result becomes, An alternative form of Fermat’s Theorem is given as  1 ( m o d p) a p  a ( m o d p ) a p  1
  • 6. EULER TOTIENT FUNCTION : φ (n)   (n) : How many numbers there are between 1 and n- 1 that are relatively prime to n.   (4) = 2 (1, 3 are relatively prime to 4).   (5) = 4 (1, 2, 3, 4 are relatively prime to 5).   (6) = 2 (1, 5 are relatively prime to 6).   (7) = 6 (1, 2, 3, 4, 5, 6 are relatively prime to 7).
  • 7. EULER TOTIENT FUNCTION : φ (n)  From  (5) and  (7), (n) will be n-1 whenever n is a prime number.  This implies that  (n) will be easy to calculate when n has exactly two different prime factors: (P * Q) = (P-1)*(Q-1) if P and Q are prime.
  • 8. Eulers Theorem a n  1mod n
  • 9. Above equation is true if n is prime because then, and Fermat’s theorem holds. Consider the set of such integers, labeled as, Here each element xi of R is unique positive integer less than n with GCD( xi ,n ) = 1. n  ( n 1)
  • 10. Proof • Multiply each element by a, modulo n : The set S is permutation of R : • Because a and xi is relatively prime to n, so multiplication is also be relatively prime to n. Thus the elements of S are integers that are less than n and that are relatively prime to n. • There are no duplicates in S.
  • 11. Proof
  • 13. Example • Solve 3 ^ 21 mod 11
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. Quiz • Who am I • I can scramble the text • One key is not enough for me • Its more secure if you exploit me Asymmetric Key Encryption / Public key encryption
  • 19. • Who am I • I was designed by 3 people • Fermats theorem is my basis • I can perform encryption • I need more than one key for my operation RSA Algorithm Quiz
  • 20. • Who am I • I was designed by 2 people • One key is not enough for me to do my operation • Discrete Logarithm is my basis • I am just used to share the personal data • I can’t hold the identity Diffie Hellman Key Exchange Algorithm Quiz