SlideShare uma empresa Scribd logo
1 de 22
RSARSA
proidiotproidiot
DC405DC405
What is RSA?What is RSA?
•
RSA is a very popular public key cryptographyRSA is a very popular public key cryptography
algorithm.algorithm.
•
RSA was described by RonRSA was described by Ron RRivest, Adiivest, Adi SShamir,hamir,
and Leonardand Leonard AAdleman from MIT in 1978 (hencedleman from MIT in 1978 (hence
the name).the name).
•
Because RSA is so strong and was also the firstBecause RSA is so strong and was also the first
public key cryptography algorithm known to bepublic key cryptography algorithm known to be
useful for both encryption and signing, RSA isuseful for both encryption and signing, RSA is
widely considered to be the first practical publicwidely considered to be the first practical public
key cryptography system.key cryptography system.
Before We Get Started...Before We Get Started...
In order to understand how RSA works, there areIn order to understand how RSA works, there are
a few other concepts you must first be familiara few other concepts you must first be familiar
with:with:
•
Modular ArithmeticModular Arithmetic
•
Prime NumbersPrime Numbers
•
CoprimalityCoprimality
•
The Totient FunctionThe Totient Function
Modular ArithmeticModular Arithmetic
•
The modulo operator maps an unconstrainedThe modulo operator maps an unconstrained
value in the constrained universe bound by 0value in the constrained universe bound by 0
and the modulus.and the modulus.
•
The modulo function is by definition equivalentThe modulo function is by definition equivalent
to finding the remainder in integer division.to finding the remainder in integer division.
•
For example:For example:
•
1515 ≡ 0 (mod 5)≡ 0 (mod 5)
•
7 ≡ 3 (mod 4)7 ≡ 3 (mod 4)
More AboutMore About
Modular ArithmeticModular Arithmetic
•
In C derivatives, you would find the modulusIn C derivatives, you would find the modulus
using syntax like:using syntax like:
•
d = a % bd = a % b
•
The above example may be written as anThe above example may be written as an
equation rather than a congruence usingequation rather than a congruence using
another constant positive integeranother constant positive integer kk::
•
a = (k * b) + da = (k * b) + d
•
It is important to know that the moduloIt is important to know that the modulo
operation is considered “destructive”; by usingoperation is considered “destructive”; by using
the modulo operator, we no longer knowthe modulo operator, we no longer know kk, and, and
Prime NumbersPrime Numbers
•
A prime number is defined to be a positiveA prime number is defined to be a positive
integer (other than 1) whose only factors are 1integer (other than 1) whose only factors are 1
and itself.and itself.
•
For example:For example:
•
7 is a prime number since the only numbers7 is a prime number since the only numbers
that can be multiplied together to get 7 are 1that can be multiplied together to get 7 are 1
and 7.and 7.
•
12 is not a prime number since 2, 3, 4, and 612 is not a prime number since 2, 3, 4, and 6
are all factors of 12 (in addition to 1 and 12).are all factors of 12 (in addition to 1 and 12).
•
It should be noted that 1 is not prime.It should be noted that 1 is not prime.
CoprimalityCoprimality
•
Two numbers are coprime if they do not shareTwo numbers are coprime if they do not share
any factors other than 1.any factors other than 1.
•
For example:For example:
•
Since 4 (whose factors are 1, 2, and 4) and 9Since 4 (whose factors are 1, 2, and 4) and 9
(whose factors are 1, 3, and 9) do not share(whose factors are 1, 3, and 9) do not share
any factors (other than 1), 4 and 9 areany factors (other than 1), 4 and 9 are
coprime.coprime.
•
Since 6 (whose factors are 1, 2, 3, and 6) andSince 6 (whose factors are 1, 2, 3, and 6) and
9 both have 3 as a factor, 6 and 9 are not9 both have 3 as a factor, 6 and 9 are not
coprime.coprime.
More AboutMore About
ComprimalityComprimality
•
Every number is coprime with 1 (sinceEvery number is coprime with 1 (since
coprimality is only concerned with any commoncoprimality is only concerned with any common
factorsfactors other thanother than 1).1).
•
No number other than 1 is coprime with itselfNo number other than 1 is coprime with itself
(since every number has itself as a factor).(since every number has itself as a factor).
•
A prime number is coprime with every numberA prime number is coprime with every number
smaller than itself (makes sense if you thinksmaller than itself (makes sense if you think
about it).about it).
The Totient FunctionThe Totient Function
•
The totient of a positive integerThe totient of a positive integer nn (denoted as(denoted as
φφ(n)(n)) is the number of positive integers less) is the number of positive integers less
than or equal tothan or equal to nn that are coprime withthat are coprime with nn..
•
For example:For example:
•
φφ(9) = 6 because 9 is coprime with 1, 2, 4, 5, 7,(9) = 6 because 9 is coprime with 1, 2, 4, 5, 7,
and 8, but not 3 or 6 or 9.and 8, but not 3 or 6 or 9.
•
φ(7) = 6 because 7 is prime, and so it isφ(7) = 6 because 7 is prime, and so it is
coprime with every number smaller thancoprime with every number smaller than
itself.itself.
More AboutMore About
The Totient FunctionThe Totient Function
•
As you've just seen, the totient of any primeAs you've just seen, the totient of any prime
number is one less than that number.number is one less than that number.
•
The totient function is multiplicative, so ifThe totient function is multiplicative, so if nn
andand mm are coprime, then:are coprime, then:
φ(n * m) = φ(n) * φ(m)φ(n * m) = φ(n) * φ(m)
•
In the event thatIn the event that nn andand mm are prime numbers,are prime numbers,
the totient of the product ofthe totient of the product of nn andand mm is easy tois easy to
calculate:calculate:
φ(n * m) = (n – 1) * (m – 1)φ(n * m) = (n – 1) * (m – 1)
What is the RSAWhat is the RSA
Algorithm?Algorithm?
•
Use two very large prime numbers to generateUse two very large prime numbers to generate
the public and the private two-part keys.the public and the private two-part keys.
•
Convert the plaintext message into a series ofConvert the plaintext message into a series of
numbers, and then encrypt that series ofnumbers, and then encrypt that series of
numbers into ciphertext using the public key.numbers into ciphertext using the public key.
•
Decrypt the ciphertext using the private key,Decrypt the ciphertext using the private key,
and then convert the resulting series ofand then convert the resulting series of
numbers back into the original plaintext.numbers back into the original plaintext.
Key GenerationKey Generation
1.1. Choose two different prime numbersChoose two different prime numbers pp andand qq..
2.2.Compute the productCompute the product nn ofof pp andand qq..
n = p * qn = p * q
3.3.Compute the totient ofCompute the totient of nn..
φ(n) = φ(p * q) = (p – 1) * (q – 1)φ(n) = φ(p * q) = (p – 1) * (q – 1)
4.4.Choose whatever positive integer you likeChoose whatever positive integer you like
between 1 andbetween 1 and φ(n)φ(n) (so long as that integer is(so long as that integer is
also coprime toalso coprime to φ(n)φ(n)) and call that integer) and call that integer ee..
5.5.Calculate the smallestCalculate the smallest dd that satisfies thethat satisfies the
congruence:congruence:
Key Generation (Cont.)Key Generation (Cont.)
•
In this case,In this case, nn will be used as the modulus forwill be used as the modulus for
encryption and decryption.encryption and decryption.
•
The encryption exponent (The encryption exponent (ee) will be used in) will be used in
encryption.encryption.
•
The decryption exponent (The decryption exponent (dd) will be used in) will be used in
decryption.decryption.
•
So, the public key isSo, the public key is (e, n)(e, n), and the private key is, and the private key is
(d, n)(d, n)..
EncryptionEncryption
1.1. Convert the plaintext into a series of integers,Convert the plaintext into a series of integers,
each of which is between 0 andeach of which is between 0 and nn..
2.2.For the first number in the series (For the first number in the series (mm), find the), find the
corresponding value for the ciphertext usingcorresponding value for the ciphertext using
the public key and the following congruence:the public key and the following congruence:
cc ≡ m≡ mee
(mod n)(mod n)
3.3.Continue to find the corresponding ciphertextContinue to find the corresponding ciphertext
values for each of the numbers in the plaintextvalues for each of the numbers in the plaintext
series, and then send the resulting ciphertextseries, and then send the resulting ciphertext
series to the person who has the private key.series to the person who has the private key.
DecryptionDecryption
1.1. For the first number in the ciphertext series (For the first number in the ciphertext series (cc),),
use the private key and the followinguse the private key and the following
congruence to find the corresponding value incongruence to find the corresponding value in
the plaintext series:the plaintext series:
mm ≡ c≡ cdd
(mod n)(mod n)
2.2.Continue performing this calculation for eachContinue performing this calculation for each
of the rest of the numbers in the ciphertextof the rest of the numbers in the ciphertext
series in order to find the rest of the plaintextseries in order to find the rest of the plaintext
series.series.
3.3.Finally, convert the numerical seriesFinally, convert the numerical series
representation of the plaintext back into therepresentation of the plaintext back into the
Example KeygenExample Keygen
(Finally!)(Finally!)
1.1. Let's have 61 and 53 be our prime numbers.Let's have 61 and 53 be our prime numbers.
2.2.So our modulus will be 61 * 53 = 3233.So our modulus will be 61 * 53 = 3233.
3.3.Since we started with prime numbers, we knowSince we started with prime numbers, we know
φ(φ(3233) = (61 – 1) * (53 – 1) = 3120.3233) = (61 – 1) * (53 – 1) = 3120.
4.4.Since 17 is prime, it's obviously coprime to 3120,Since 17 is prime, it's obviously coprime to 3120,
so we'll use it for our encryption exponent.so we'll use it for our encryption exponent.
5.5.Using a nasty-looking algorithm, we would seeUsing a nasty-looking algorithm, we would see
that 2753 is the smallest correspondingthat 2753 is the smallest corresponding
decryption exponent.decryption exponent.
Example EncryptionExample Encryption
Using our public key (which is 3233, 17), if weUsing our public key (which is 3233, 17), if we
have a message that is represented as 123 inhave a message that is represented as 123 in
numerical form, we calculate the ciphertextnumerical form, we calculate the ciphertext
using 123 ^ 17 (mod 3233), which gives 855.using 123 ^ 17 (mod 3233), which gives 855.
Example DecryptionExample Decryption
Using our private key (which is 3233, 2753) andUsing our private key (which is 3233, 2753) and
the ciphertext (855) , we can decrypt thethe ciphertext (855) , we can decrypt the
message by finding 855 ^ 2573 (mod 3233),message by finding 855 ^ 2573 (mod 3233),
which, sure enough, gives us 123.which, sure enough, gives us 123.
Why Does This Work?Why Does This Work?
•
Let's look at the decryption equation again:Let's look at the decryption equation again:
•
mm ≡ c≡ cdd
(mod n)(mod n)
•
By using the encryption equation to substituteBy using the encryption equation to substitute
forfor cc, we get:, we get:
•
m ≡ mm ≡ me * de * d
(mod n)(mod n)
•
If you remember the equation for the modulusIf you remember the equation for the modulus
and how we definedand how we defined d * ed * e, we see that:, we see that:
•
d * e = (k * φ(n)) + 1d * e = (k * φ(n)) + 1
Why Does This Work?Why Does This Work?
(Cont.)(Cont.)
•
Know our equation looks like:Know our equation looks like:
•
m ≡ m * mm ≡ m * mk * φ(n)k * φ(n)
(mod n)(mod n)
•
The following (called Euler's equation) is knownThe following (called Euler's equation) is known
to be true whento be true when aa andand nn are coprime:are coprime:
•
aaφ(n)φ(n)
≡ 1 (mod n)≡ 1 (mod n)
•
So now we have it:So now we have it:
•
m ≡ m (mod n) (obviously true since m < n)m ≡ m (mod n) (obviously true since m < n)
Where is RSA Used?Where is RSA Used?
•
PGP/GPG EncryptionPGP/GPG Encryption
•
PGP/GPG Key SigningPGP/GPG Key Signing
•
SSL SignaturesSSL Signatures
How Do I Break RSA?How Do I Break RSA?
•
Well, you could do it wrong if you don't payWell, you could do it wrong if you don't pay
attention...attention...
•
We don't really care aboutWe don't really care about kk (thank you, natural(thank you, natural
numbers!), so all we really want to know isnumbers!), so all we really want to know is φ(n)φ(n)..
•
Since we knowSince we know φ(n) = (p – 1) * (q – 1)φ(n) = (p – 1) * (q – 1), using, using
FOIL from Algebra 1 shows us thatFOIL from Algebra 1 shows us that φ(n) = (p *φ(n) = (p *
q) – p – q + 1q) – p – q + 1, and since, and since (p * q) = n(p * q) = n, all we, all we
need to do is factorneed to do is factor nn..
•
If you know of a non-quantum algorithm thatIf you know of a non-quantum algorithm that
can do integer factorization faster thancan do integer factorization faster than
exponential time, please let me know. I'll payexponential time, please let me know. I'll pay

Mais conteúdo relacionado

Mais procurados (20)

Network security cs5
Network security cs5Network security cs5
Network security cs5
 
RSA Algorithm report
RSA Algorithm reportRSA Algorithm report
RSA Algorithm report
 
The rsa algorithm JooSeok Song
The rsa algorithm JooSeok SongThe rsa algorithm JooSeok Song
The rsa algorithm JooSeok Song
 
Mathematical Statistics Assignment Help
Mathematical Statistics Assignment HelpMathematical Statistics Assignment Help
Mathematical Statistics Assignment Help
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
Into to prob_prog_hari (2)
Into to prob_prog_hari (2)Into to prob_prog_hari (2)
Into to prob_prog_hari (2)
 
Rsa rivest shamir adleman
Rsa rivest shamir adlemanRsa rivest shamir adleman
Rsa rivest shamir adleman
 
Unit 3
Unit 3Unit 3
Unit 3
 
Assignment 2 daa
Assignment 2 daaAssignment 2 daa
Assignment 2 daa
 
Lattice Cryptography
Lattice CryptographyLattice Cryptography
Lattice Cryptography
 
On deriving the private key from a public key
On deriving the private key from a public keyOn deriving the private key from a public key
On deriving the private key from a public key
 
Close Graph
Close GraphClose Graph
Close Graph
 
Improved security system using steganography and elliptic curve crypto...
Improved  security  system using  steganography  and  elliptic  curve  crypto...Improved  security  system using  steganography  and  elliptic  curve  crypto...
Improved security system using steganography and elliptic curve crypto...
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
RSA cracking puzzle
RSA cracking puzzleRSA cracking puzzle
RSA cracking puzzle
 
Rsa Algorithm
Rsa AlgorithmRsa Algorithm
Rsa Algorithm
 
Chapter 06 rsa cryptosystem
Chapter 06   rsa cryptosystemChapter 06   rsa cryptosystem
Chapter 06 rsa cryptosystem
 
Rsa documentation
Rsa documentationRsa documentation
Rsa documentation
 
On the Secrecy of RSA Private Keys
On the Secrecy of RSA Private KeysOn the Secrecy of RSA Private Keys
On the Secrecy of RSA Private Keys
 

Destaque

Destaque (14)

RSA-W7(rsa) d1-d2
RSA-W7(rsa) d1-d2RSA-W7(rsa) d1-d2
RSA-W7(rsa) d1-d2
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
 
Robustness testing
Robustness testingRobustness testing
Robustness testing
 
Presentacion diapositiva 40
Presentacion diapositiva 40Presentacion diapositiva 40
Presentacion diapositiva 40
 
Security Attacks on RSA
Security Attacks on RSASecurity Attacks on RSA
Security Attacks on RSA
 
Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)
 
Ch08
Ch08Ch08
Ch08
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
RSA & MD5 algorithm
RSA & MD5 algorithmRSA & MD5 algorithm
RSA & MD5 algorithm
 
RSA algorithm
RSA algorithmRSA algorithm
RSA algorithm
 
FULLSIGHTS. DIGITAL KNOCKOUTS
FULLSIGHTS. DIGITAL KNOCKOUTSFULLSIGHTS. DIGITAL KNOCKOUTS
FULLSIGHTS. DIGITAL KNOCKOUTS
 
Message Authentication using Message Digests and the MD5 Algorithm
Message Authentication using Message Digests and the MD5 AlgorithmMessage Authentication using Message Digests and the MD5 Algorithm
Message Authentication using Message Digests and the MD5 Algorithm
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 

Semelhante a RSA

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
 
11 Applied_Mathemathics HANDBOOK.pdf
11 Applied_Mathemathics HANDBOOK.pdf11 Applied_Mathemathics HANDBOOK.pdf
11 Applied_Mathemathics HANDBOOK.pdfVipinNegi38
 
Cyber Security Part-3.pptx
Cyber Security Part-3.pptxCyber Security Part-3.pptx
Cyber Security Part-3.pptxRavikumarVadana
 
Basics of Mathematical Cryptography
Basics of Mathematical CryptographyBasics of Mathematical Cryptography
Basics of Mathematical CryptographyNeha Gupta
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiouvafopoulos
 
Prime Numbers and Their Digital Roots
Prime Numbers and Their Digital RootsPrime Numbers and Their Digital Roots
Prime Numbers and Their Digital RootsIRJET Journal
 
Tenth class state syllabus-text book-em-ap-ts-mathematics
Tenth class state syllabus-text book-em-ap-ts-mathematicsTenth class state syllabus-text book-em-ap-ts-mathematics
Tenth class state syllabus-text book-em-ap-ts-mathematicsNaukriTuts
 
Number theory and cryptography
Number theory and cryptographyNumber theory and cryptography
Number theory and cryptographyYasser Ali
 
Information and network security 33 rsa algorithm
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithmVaibhav Khanna
 
chapter1.pdf ......................................
chapter1.pdf ......................................chapter1.pdf ......................................
chapter1.pdf ......................................nourhandardeer3
 

Semelhante a RSA (20)

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
 
11 Applied_Mathemathics HANDBOOK.pdf
11 Applied_Mathemathics HANDBOOK.pdf11 Applied_Mathemathics HANDBOOK.pdf
11 Applied_Mathemathics HANDBOOK.pdf
 
Cyber Security Part-3.pptx
Cyber Security Part-3.pptxCyber Security Part-3.pptx
Cyber Security Part-3.pptx
 
Basics of Mathematical Cryptography
Basics of Mathematical CryptographyBasics of Mathematical Cryptography
Basics of Mathematical Cryptography
 
2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou2010 3-24 cryptography stamatiou
2010 3-24 cryptography stamatiou
 
Public Key and RSA.pdf
Public Key and RSA.pdfPublic Key and RSA.pdf
Public Key and RSA.pdf
 
Prime Numbers and Their Digital Roots
Prime Numbers and Their Digital RootsPrime Numbers and Their Digital Roots
Prime Numbers and Their Digital Roots
 
1.2 matlab numerical data
1.2  matlab numerical data1.2  matlab numerical data
1.2 matlab numerical data
 
CH4__crypto.pptx
CH4__crypto.pptxCH4__crypto.pptx
CH4__crypto.pptx
 
Tenth class state syllabus-text book-em-ap-ts-mathematics
Tenth class state syllabus-text book-em-ap-ts-mathematicsTenth class state syllabus-text book-em-ap-ts-mathematics
Tenth class state syllabus-text book-em-ap-ts-mathematics
 
Prime number generation
Prime number generationPrime number generation
Prime number generation
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
Ch08
Ch08Ch08
Ch08
 
Number theory and cryptography
Number theory and cryptographyNumber theory and cryptography
Number theory and cryptography
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Information and network security 33 rsa algorithm
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithm
 
chapter1.pdf ......................................
chapter1.pdf ......................................chapter1.pdf ......................................
chapter1.pdf ......................................
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
PEA305 workbook.pdf
PEA305 workbook.pdfPEA305 workbook.pdf
PEA305 workbook.pdf
 
Decision Tree.pptx
Decision Tree.pptxDecision Tree.pptx
Decision Tree.pptx
 

Mais de Charles Southerland

Mais de Charles Southerland (11)

hextime (OKC LUGnuts 5C393C35)
hextime (OKC LUGnuts 5C393C35)hextime (OKC LUGnuts 5C393C35)
hextime (OKC LUGnuts 5C393C35)
 
HTTPS Sucks
HTTPS SucksHTTPS Sucks
HTTPS Sucks
 
Authentication Concepts
Authentication ConceptsAuthentication Concepts
Authentication Concepts
 
Linux Users are People, Too!
Linux Users are People, Too!Linux Users are People, Too!
Linux Users are People, Too!
 
Passwords
PasswordsPasswords
Passwords
 
Program Derivation of Operations in Finite Fields of Prime Order
Program Derivation of Operations in Finite Fields of Prime OrderProgram Derivation of Operations in Finite Fields of Prime Order
Program Derivation of Operations in Finite Fields of Prime Order
 
Program Derivation of Matrix Operations in GF
Program Derivation of Matrix Operations in GFProgram Derivation of Matrix Operations in GF
Program Derivation of Matrix Operations in GF
 
Logs And Backups
Logs And BackupsLogs And Backups
Logs And Backups
 
C Is Not Dead Yet
C Is Not Dead YetC Is Not Dead Yet
C Is Not Dead Yet
 
All Your Password Are Belong To Us
All Your Password Are Belong To UsAll Your Password Are Belong To Us
All Your Password Are Belong To Us
 
One-Time Pad Encryption
One-Time Pad EncryptionOne-Time Pad Encryption
One-Time Pad Encryption
 

Último

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Último (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

RSA

  • 2. What is RSA?What is RSA? • RSA is a very popular public key cryptographyRSA is a very popular public key cryptography algorithm.algorithm. • RSA was described by RonRSA was described by Ron RRivest, Adiivest, Adi SShamir,hamir, and Leonardand Leonard AAdleman from MIT in 1978 (hencedleman from MIT in 1978 (hence the name).the name). • Because RSA is so strong and was also the firstBecause RSA is so strong and was also the first public key cryptography algorithm known to bepublic key cryptography algorithm known to be useful for both encryption and signing, RSA isuseful for both encryption and signing, RSA is widely considered to be the first practical publicwidely considered to be the first practical public key cryptography system.key cryptography system.
  • 3. Before We Get Started...Before We Get Started... In order to understand how RSA works, there areIn order to understand how RSA works, there are a few other concepts you must first be familiara few other concepts you must first be familiar with:with: • Modular ArithmeticModular Arithmetic • Prime NumbersPrime Numbers • CoprimalityCoprimality • The Totient FunctionThe Totient Function
  • 4. Modular ArithmeticModular Arithmetic • The modulo operator maps an unconstrainedThe modulo operator maps an unconstrained value in the constrained universe bound by 0value in the constrained universe bound by 0 and the modulus.and the modulus. • The modulo function is by definition equivalentThe modulo function is by definition equivalent to finding the remainder in integer division.to finding the remainder in integer division. • For example:For example: • 1515 ≡ 0 (mod 5)≡ 0 (mod 5) • 7 ≡ 3 (mod 4)7 ≡ 3 (mod 4)
  • 5. More AboutMore About Modular ArithmeticModular Arithmetic • In C derivatives, you would find the modulusIn C derivatives, you would find the modulus using syntax like:using syntax like: • d = a % bd = a % b • The above example may be written as anThe above example may be written as an equation rather than a congruence usingequation rather than a congruence using another constant positive integeranother constant positive integer kk:: • a = (k * b) + da = (k * b) + d • It is important to know that the moduloIt is important to know that the modulo operation is considered “destructive”; by usingoperation is considered “destructive”; by using the modulo operator, we no longer knowthe modulo operator, we no longer know kk, and, and
  • 6. Prime NumbersPrime Numbers • A prime number is defined to be a positiveA prime number is defined to be a positive integer (other than 1) whose only factors are 1integer (other than 1) whose only factors are 1 and itself.and itself. • For example:For example: • 7 is a prime number since the only numbers7 is a prime number since the only numbers that can be multiplied together to get 7 are 1that can be multiplied together to get 7 are 1 and 7.and 7. • 12 is not a prime number since 2, 3, 4, and 612 is not a prime number since 2, 3, 4, and 6 are all factors of 12 (in addition to 1 and 12).are all factors of 12 (in addition to 1 and 12). • It should be noted that 1 is not prime.It should be noted that 1 is not prime.
  • 7. CoprimalityCoprimality • Two numbers are coprime if they do not shareTwo numbers are coprime if they do not share any factors other than 1.any factors other than 1. • For example:For example: • Since 4 (whose factors are 1, 2, and 4) and 9Since 4 (whose factors are 1, 2, and 4) and 9 (whose factors are 1, 3, and 9) do not share(whose factors are 1, 3, and 9) do not share any factors (other than 1), 4 and 9 areany factors (other than 1), 4 and 9 are coprime.coprime. • Since 6 (whose factors are 1, 2, 3, and 6) andSince 6 (whose factors are 1, 2, 3, and 6) and 9 both have 3 as a factor, 6 and 9 are not9 both have 3 as a factor, 6 and 9 are not coprime.coprime.
  • 8. More AboutMore About ComprimalityComprimality • Every number is coprime with 1 (sinceEvery number is coprime with 1 (since coprimality is only concerned with any commoncoprimality is only concerned with any common factorsfactors other thanother than 1).1). • No number other than 1 is coprime with itselfNo number other than 1 is coprime with itself (since every number has itself as a factor).(since every number has itself as a factor). • A prime number is coprime with every numberA prime number is coprime with every number smaller than itself (makes sense if you thinksmaller than itself (makes sense if you think about it).about it).
  • 9. The Totient FunctionThe Totient Function • The totient of a positive integerThe totient of a positive integer nn (denoted as(denoted as φφ(n)(n)) is the number of positive integers less) is the number of positive integers less than or equal tothan or equal to nn that are coprime withthat are coprime with nn.. • For example:For example: • φφ(9) = 6 because 9 is coprime with 1, 2, 4, 5, 7,(9) = 6 because 9 is coprime with 1, 2, 4, 5, 7, and 8, but not 3 or 6 or 9.and 8, but not 3 or 6 or 9. • φ(7) = 6 because 7 is prime, and so it isφ(7) = 6 because 7 is prime, and so it is coprime with every number smaller thancoprime with every number smaller than itself.itself.
  • 10. More AboutMore About The Totient FunctionThe Totient Function • As you've just seen, the totient of any primeAs you've just seen, the totient of any prime number is one less than that number.number is one less than that number. • The totient function is multiplicative, so ifThe totient function is multiplicative, so if nn andand mm are coprime, then:are coprime, then: φ(n * m) = φ(n) * φ(m)φ(n * m) = φ(n) * φ(m) • In the event thatIn the event that nn andand mm are prime numbers,are prime numbers, the totient of the product ofthe totient of the product of nn andand mm is easy tois easy to calculate:calculate: φ(n * m) = (n – 1) * (m – 1)φ(n * m) = (n – 1) * (m – 1)
  • 11. What is the RSAWhat is the RSA Algorithm?Algorithm? • Use two very large prime numbers to generateUse two very large prime numbers to generate the public and the private two-part keys.the public and the private two-part keys. • Convert the plaintext message into a series ofConvert the plaintext message into a series of numbers, and then encrypt that series ofnumbers, and then encrypt that series of numbers into ciphertext using the public key.numbers into ciphertext using the public key. • Decrypt the ciphertext using the private key,Decrypt the ciphertext using the private key, and then convert the resulting series ofand then convert the resulting series of numbers back into the original plaintext.numbers back into the original plaintext.
  • 12. Key GenerationKey Generation 1.1. Choose two different prime numbersChoose two different prime numbers pp andand qq.. 2.2.Compute the productCompute the product nn ofof pp andand qq.. n = p * qn = p * q 3.3.Compute the totient ofCompute the totient of nn.. φ(n) = φ(p * q) = (p – 1) * (q – 1)φ(n) = φ(p * q) = (p – 1) * (q – 1) 4.4.Choose whatever positive integer you likeChoose whatever positive integer you like between 1 andbetween 1 and φ(n)φ(n) (so long as that integer is(so long as that integer is also coprime toalso coprime to φ(n)φ(n)) and call that integer) and call that integer ee.. 5.5.Calculate the smallestCalculate the smallest dd that satisfies thethat satisfies the congruence:congruence:
  • 13. Key Generation (Cont.)Key Generation (Cont.) • In this case,In this case, nn will be used as the modulus forwill be used as the modulus for encryption and decryption.encryption and decryption. • The encryption exponent (The encryption exponent (ee) will be used in) will be used in encryption.encryption. • The decryption exponent (The decryption exponent (dd) will be used in) will be used in decryption.decryption. • So, the public key isSo, the public key is (e, n)(e, n), and the private key is, and the private key is (d, n)(d, n)..
  • 14. EncryptionEncryption 1.1. Convert the plaintext into a series of integers,Convert the plaintext into a series of integers, each of which is between 0 andeach of which is between 0 and nn.. 2.2.For the first number in the series (For the first number in the series (mm), find the), find the corresponding value for the ciphertext usingcorresponding value for the ciphertext using the public key and the following congruence:the public key and the following congruence: cc ≡ m≡ mee (mod n)(mod n) 3.3.Continue to find the corresponding ciphertextContinue to find the corresponding ciphertext values for each of the numbers in the plaintextvalues for each of the numbers in the plaintext series, and then send the resulting ciphertextseries, and then send the resulting ciphertext series to the person who has the private key.series to the person who has the private key.
  • 15. DecryptionDecryption 1.1. For the first number in the ciphertext series (For the first number in the ciphertext series (cc),), use the private key and the followinguse the private key and the following congruence to find the corresponding value incongruence to find the corresponding value in the plaintext series:the plaintext series: mm ≡ c≡ cdd (mod n)(mod n) 2.2.Continue performing this calculation for eachContinue performing this calculation for each of the rest of the numbers in the ciphertextof the rest of the numbers in the ciphertext series in order to find the rest of the plaintextseries in order to find the rest of the plaintext series.series. 3.3.Finally, convert the numerical seriesFinally, convert the numerical series representation of the plaintext back into therepresentation of the plaintext back into the
  • 16. Example KeygenExample Keygen (Finally!)(Finally!) 1.1. Let's have 61 and 53 be our prime numbers.Let's have 61 and 53 be our prime numbers. 2.2.So our modulus will be 61 * 53 = 3233.So our modulus will be 61 * 53 = 3233. 3.3.Since we started with prime numbers, we knowSince we started with prime numbers, we know φ(φ(3233) = (61 – 1) * (53 – 1) = 3120.3233) = (61 – 1) * (53 – 1) = 3120. 4.4.Since 17 is prime, it's obviously coprime to 3120,Since 17 is prime, it's obviously coprime to 3120, so we'll use it for our encryption exponent.so we'll use it for our encryption exponent. 5.5.Using a nasty-looking algorithm, we would seeUsing a nasty-looking algorithm, we would see that 2753 is the smallest correspondingthat 2753 is the smallest corresponding decryption exponent.decryption exponent.
  • 17. Example EncryptionExample Encryption Using our public key (which is 3233, 17), if weUsing our public key (which is 3233, 17), if we have a message that is represented as 123 inhave a message that is represented as 123 in numerical form, we calculate the ciphertextnumerical form, we calculate the ciphertext using 123 ^ 17 (mod 3233), which gives 855.using 123 ^ 17 (mod 3233), which gives 855.
  • 18. Example DecryptionExample Decryption Using our private key (which is 3233, 2753) andUsing our private key (which is 3233, 2753) and the ciphertext (855) , we can decrypt thethe ciphertext (855) , we can decrypt the message by finding 855 ^ 2573 (mod 3233),message by finding 855 ^ 2573 (mod 3233), which, sure enough, gives us 123.which, sure enough, gives us 123.
  • 19. Why Does This Work?Why Does This Work? • Let's look at the decryption equation again:Let's look at the decryption equation again: • mm ≡ c≡ cdd (mod n)(mod n) • By using the encryption equation to substituteBy using the encryption equation to substitute forfor cc, we get:, we get: • m ≡ mm ≡ me * de * d (mod n)(mod n) • If you remember the equation for the modulusIf you remember the equation for the modulus and how we definedand how we defined d * ed * e, we see that:, we see that: • d * e = (k * φ(n)) + 1d * e = (k * φ(n)) + 1
  • 20. Why Does This Work?Why Does This Work? (Cont.)(Cont.) • Know our equation looks like:Know our equation looks like: • m ≡ m * mm ≡ m * mk * φ(n)k * φ(n) (mod n)(mod n) • The following (called Euler's equation) is knownThe following (called Euler's equation) is known to be true whento be true when aa andand nn are coprime:are coprime: • aaφ(n)φ(n) ≡ 1 (mod n)≡ 1 (mod n) • So now we have it:So now we have it: • m ≡ m (mod n) (obviously true since m < n)m ≡ m (mod n) (obviously true since m < n)
  • 21. Where is RSA Used?Where is RSA Used? • PGP/GPG EncryptionPGP/GPG Encryption • PGP/GPG Key SigningPGP/GPG Key Signing • SSL SignaturesSSL Signatures
  • 22. How Do I Break RSA?How Do I Break RSA? • Well, you could do it wrong if you don't payWell, you could do it wrong if you don't pay attention...attention... • We don't really care aboutWe don't really care about kk (thank you, natural(thank you, natural numbers!), so all we really want to know isnumbers!), so all we really want to know is φ(n)φ(n).. • Since we knowSince we know φ(n) = (p – 1) * (q – 1)φ(n) = (p – 1) * (q – 1), using, using FOIL from Algebra 1 shows us thatFOIL from Algebra 1 shows us that φ(n) = (p *φ(n) = (p * q) – p – q + 1q) – p – q + 1, and since, and since (p * q) = n(p * q) = n, all we, all we need to do is factorneed to do is factor nn.. • If you know of a non-quantum algorithm thatIf you know of a non-quantum algorithm that can do integer factorization faster thancan do integer factorization faster than exponential time, please let me know. I'll payexponential time, please let me know. I'll pay