SlideShare a Scribd company logo
Asymmetric Cryptography
February 8, 2017
Why Cryptography?
● Confidentiality - only intended parties can read contents
● Integrity - message tampering can be detected
● Authentication - the author is verified
● Nonrepudiation - the author cannot deny being the author
Why asymmetric cryptography?
● No need to secretly distribute key
● Difficult to brute-force
● Reuse of key does not significantly weaken security
Why not asymmetric cryptography?
● More computationally-intensive than symmetric
cryptography
RSA
● Developed by Rivest, Shamir, and Adleman in 1977
● Based on the difficulty of factoring product of 2 large
primes, being able to compute private key from public key
● Built-in confidentiality, authentication, integrity, and
nonrepudiation from owner
● Computationally expensive
RSA Keys
● Public and private key should be prime numbers ≥ 2048
bits
● Public key should be available to everyone
○ Ex) Distribute using keyserver
● Private key should be known only to the owner of key pair
Key Generation and
Encryption/Decryption
RSA Key Generation
1. Pick primes of similar length (p = 61, q = 53)
2. Compute N as p x q (61 x 53 = 3233)
3. Compute the totient of N (60 x 52 = 3120)
4. Chose public exponent e that is coprime to N (17)
5. Compute the modular multiplicative inverse of e mod totient(N) (2753)
RSA Encryption
● e(m) = me
mod N = c
● d(c) = cd
mod N = m
Because:
● d(me
) = med
mod N = m -- ed = 1 + hφ(n) (Definition of multiplicative inverse)
● m1 + hφ(n)
mod N = m
● m(mφ(n)
)h
mod N = m -- aφ(n)
= 1 mod N (Euler’s Theorem)
● m(1)h
mod N = m
Uses for RSA
● First connection in SSL/TLS
● Signing communication
○ More efficient to encrypt hash of message rather than
whole message
● Subscription-based services like commercial TV, radio,
etc.
Diffie-Hellman Key Exchange
● Developed and published by Whitfield Diffie and Martin
Hellman in 1976
● Relies on difficulty of discrete logarithm problem
● Forward secrecy
● Can be performed with more than two parties
● More efficient than RSA
Diffie-Hellman Keys
● Communicating parties agree on a exponential base (g)
and prime modulus (p)
● Each communicating party generates a secret value to
use for exponentiation
● Shared symmetric key can be generated securely over
public network
○ Negotiation steps, if captured, should not give away
key
Key Generation and
Encryption/Decryption
Diffie Hellman Key Exchange
1. Alice and Bob agree on p = 23 and g = 5 (which is primitive root mod 23)
2. Alice chooses a = 6, and sends Bob A = 56
mod 23 = 8
3. Bob chooses b = 15, and sends Alice B = 515
mod 23 = 19
4. S = Ab
mod p = 815
mod 23 = 2
5. S = Ba
mod p = 196
mod 23 = 2
Uses for Diffie-Hellman
● Key negotiation over public or unsecured channels
(especially Ephemeral Diffie-Hellman)
○ Part of SSL/TLS
○ IPSec/VPN
○ SSH
Attacks on Public Key Cryptography
Timeline of “Modern” Cryptography
Post World War II - Cryptography is regulated as munitions (can’t be exported)
1975 - DES Published
1976 - Diffie-Hellman Key Exchange published
1977 - RSA published
1977 - DES Standardized (FIPS)
1985 - Amiga 1000 released
1989 - Public commercial use of the internet
1991 - PGP Released (First major instance of personal cryptography)
1993 - PGP finds it way out of the United States
1996 - Bernstein v. United States (Cryptography Export laws)
1996 - SSLv3 released (containing export grade cryptography)
Factoring RSA Export Keys
● FREAK
● March 3, 2015
● CVE-2015-0204
● Capitalizes on forcing the server to use RSA_EXPORT keys
● RSA_EXPORT Keys are 512 bits or less
● RSA_EXPORT keys were designed to be a backdoor, good enough for public
use, bad enough for the NSA to be able to break if needed
● 9.6% of top million domains vulnerable
Factoring RSA Export Keys
● Man in the Middle attack that requests RSA_EXPORT keys
● Most servers just go with it
● Most clients just go with it
● Generally one RSA_EXPORT key per server
● As seen in the diagram, knowing the premaster secret breaks the session
CADO-NFS
● Implementation of Number Field Sieve
● Current fastest way to factor large numbers
● Current fastest way to compute discrete logarithm
● Can break 512 bit RSA keys in 7 hours for ~$100 on EC2
Logjam
● October 2015
● CVE-2015-4000
● Capitalizes on forcing the server to use DHE_EXPORT parameters
● Tricks the client into thinking they are standard DHE
● 8.4% of the top million domains vulnerable
Number Field Sieve for Discrete Log
“Mining your P’s and Q’s”
● Low entropy RSA keys may share a common prime
● This prime can be found trivially with Euclid’s GCD Algorithm
● Finding one prime makes the other trivial to find, making generating a private
key trivial to find
Euclidean Algorithm for GCD
function gcd(a, b)
while b ≠ 0
t := b;
b := a mod b;
a := t;
return a;
More Resources:
● https://www.id0-rsa.pub/ - Cryptography Challenges
● https://www.youtube.com/watch?v=2aHkqB2-46k - Cryptography Lectures
● https://weakdh.org - Logjam Website
● https://mitls.org/pages/attacks/SMACK#freak - Freak Website
● https://factorable.net/ - Mining your P’s and Q’s
● https://github.com/kulinacs/smashcipher - Factor RSA library
Questions?
Future Events
● Introduction to Pentesting - Saturday, February 11th, 12 PM - 3 PM
● Coming up in March: Binary Exploitation
● CTFs for the semester (subject to change):
○ Boston Key Party (February 25th & 26th)
○ VolgaCTF (March 24th - 26th)
○ ASIS CTF (April 7th - 9th)

More Related Content

What's hot

Digital signature(Cryptography)
Digital signature(Cryptography)Digital signature(Cryptography)
Digital signature(Cryptography)
Soham Kansodaria
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
zahid-mian
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
Gopal Sakarkar
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONraf_slide
 
Digital Signature Standard
Digital Signature StandardDigital Signature Standard
Digital Signature Standard
Sou Jana
 
Pgp
PgpPgp
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
What is Asymmetric Encryption? Understand with Simple Examples
What is Asymmetric Encryption? Understand with Simple ExamplesWhat is Asymmetric Encryption? Understand with Simple Examples
What is Asymmetric Encryption? Understand with Simple Examples
CheapSSLsecurity
 
Cryptography
CryptographyCryptography
Cryptography
CryptographyCryptography
Cryptography
Shivanand Arur
 
Cryptography
CryptographyCryptography
Cryptography
jayashri kolekar
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
Amit Pathak
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
kusum sharma
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
Md. Afif Al Mamun
 
User authentication
User authenticationUser authentication
User authentication
CAS
 
Applied Cryptography
Applied CryptographyApplied Cryptography
Applied Cryptography
Marcelo Martins
 
Symmetric encryption and message confidentiality
Symmetric encryption and message confidentialitySymmetric encryption and message confidentiality
Symmetric encryption and message confidentiality
CAS
 

What's hot (20)

Digital signature(Cryptography)
Digital signature(Cryptography)Digital signature(Cryptography)
Digital signature(Cryptography)
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTION
 
Digital Signature Standard
Digital Signature StandardDigital Signature Standard
Digital Signature Standard
 
Pgp
PgpPgp
Pgp
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
What is Asymmetric Encryption? Understand with Simple Examples
What is Asymmetric Encryption? Understand with Simple ExamplesWhat is Asymmetric Encryption? Understand with Simple Examples
What is Asymmetric Encryption? Understand with Simple Examples
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography and network security Nit701
Cryptography and network security Nit701Cryptography and network security Nit701
Cryptography and network security Nit701
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Symmetric and asymmetric key
Symmetric and asymmetric keySymmetric and asymmetric key
Symmetric and asymmetric key
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
User authentication
User authenticationUser authentication
User authentication
 
Applied Cryptography
Applied CryptographyApplied Cryptography
Applied Cryptography
 
Symmetric encryption and message confidentiality
Symmetric encryption and message confidentialitySymmetric encryption and message confidentiality
Symmetric encryption and message confidentiality
 

Similar to Asymmetric Cryptography

Intro to Cryptography
Intro to CryptographyIntro to Cryptography
Intro to Cryptography
Galin Dinkov
 
Presentation
PresentationPresentation
Presentation
rokham khawaja
 
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptxUnit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
VishwanathMahalle
 
Ch9
Ch9Ch9
Pooguzhali
PooguzhaliPooguzhali
CNIT 141 11. Diffie-Hellman
CNIT 141 11. Diffie-Hellman	CNIT 141 11. Diffie-Hellman
CNIT 141 11. Diffie-Hellman
Sam Bowne
 
Applying Security Algorithms Using openSSL crypto library
Applying Security Algorithms Using openSSL crypto libraryApplying Security Algorithms Using openSSL crypto library
Applying Security Algorithms Using openSSL crypto library
Priyank Kapadia
 
CISSP Week 20
CISSP Week 20CISSP Week 20
CISSP Week 20jemtallon
 
OpenPGP/GnuPG Encryption
OpenPGP/GnuPG EncryptionOpenPGP/GnuPG Encryption
OpenPGP/GnuPG Encryption
Tanner Lovelace
 
Kleptography
KleptographyKleptography
Kleptography
Erfan Mallick
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
Sam Bowne
 
Strong cryptography in PHP
Strong cryptography in PHPStrong cryptography in PHP
Strong cryptography in PHP
Enrico Zimuel
 
Cryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric EncryptionCryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric Encryption
Abdul Manaf Vellakodath
 
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptxRivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
werip98386
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
Md. Shafiul Alam Sagor
 
Digital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmDigital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA Algorithm
Vinayak Raja
 
Cryptography 101
Cryptography 101Cryptography 101
Cryptography 101
Aditya Kamat
 
Whitepaper - Protecting Data in Transit
Whitepaper - Protecting Data in TransitWhitepaper - Protecting Data in Transit
Whitepaper - Protecting Data in Transit
Phil Bartlett
 

Similar to Asymmetric Cryptography (20)

Intro to Cryptography
Intro to CryptographyIntro to Cryptography
Intro to Cryptography
 
Presentation
PresentationPresentation
Presentation
 
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptxUnit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
 
Ch9
Ch9Ch9
Ch9
 
Pooguzhali
PooguzhaliPooguzhali
Pooguzhali
 
CNIT 141 11. Diffie-Hellman
CNIT 141 11. Diffie-Hellman	CNIT 141 11. Diffie-Hellman
CNIT 141 11. Diffie-Hellman
 
Applying Security Algorithms Using openSSL crypto library
Applying Security Algorithms Using openSSL crypto libraryApplying Security Algorithms Using openSSL crypto library
Applying Security Algorithms Using openSSL crypto library
 
CISSP Week 20
CISSP Week 20CISSP Week 20
CISSP Week 20
 
OpenPGP/GnuPG Encryption
OpenPGP/GnuPG EncryptionOpenPGP/GnuPG Encryption
OpenPGP/GnuPG Encryption
 
Kleptography
KleptographyKleptography
Kleptography
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
Strong cryptography in PHP
Strong cryptography in PHPStrong cryptography in PHP
Strong cryptography in PHP
 
Rsa
RsaRsa
Rsa
 
Cryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric EncryptionCryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric Encryption
 
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptxRivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
 
Digital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmDigital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA Algorithm
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
 
Cryptography 101
Cryptography 101Cryptography 101
Cryptography 101
 
Whitepaper - Protecting Data in Transit
Whitepaper - Protecting Data in TransitWhitepaper - Protecting Data in Transit
Whitepaper - Protecting Data in Transit
 

More from UTD Computer Security Group

22S kickoff 2.0 (kickoff + anonymity talk)
22S kickoff 2.0 (kickoff + anonymity talk)22S kickoff 2.0 (kickoff + anonymity talk)
22S kickoff 2.0 (kickoff + anonymity talk)
UTD Computer Security Group
 
Cloud talk
Cloud talkCloud talk
UTD Computer Security Group - Cracking the domain
UTD Computer Security Group - Cracking the domainUTD Computer Security Group - Cracking the domain
UTD Computer Security Group - Cracking the domain
UTD Computer Security Group
 
Forensics audio and video
Forensics   audio and videoForensics   audio and video
Forensics audio and video
UTD Computer Security Group
 
Computer networks and network security
Computer networks and network securityComputer networks and network security
Computer networks and network security
UTD Computer Security Group
 
Intro to python
Intro to pythonIntro to python
Powershell crash course
Powershell crash coursePowershell crash course
Powershell crash course
UTD Computer Security Group
 
Intro to cybersecurity
Intro to cybersecurityIntro to cybersecurity
Intro to cybersecurity
UTD Computer Security Group
 
Intro to Bash
Intro to BashIntro to Bash
Web Exploitation
Web ExploitationWeb Exploitation
Web Exploitation
UTD Computer Security Group
 
Network Exploitation
Network ExploitationNetwork Exploitation
Network Exploitation
UTD Computer Security Group
 
Penetration Testing: Celestial
Penetration Testing: CelestialPenetration Testing: Celestial
Penetration Testing: Celestial
UTD Computer Security Group
 
Introduction to Exploitation
Introduction to ExploitationIntroduction to Exploitation
Introduction to Exploitation
UTD Computer Security Group
 
Cryptography Crash Course
Cryptography Crash CourseCryptography Crash Course
Cryptography Crash Course
UTD Computer Security Group
 
Fuzzing - Part 2
Fuzzing - Part 2Fuzzing - Part 2
Fuzzing - Part 2
UTD Computer Security Group
 
Exploitation Crash Course
Exploitation Crash CourseExploitation Crash Course
Exploitation Crash Course
UTD Computer Security Group
 
Fuzzing - Part 1
Fuzzing - Part 1Fuzzing - Part 1
Fuzzing - Part 1
UTD Computer Security Group
 
Protostar VM - Heap3
Protostar VM - Heap3Protostar VM - Heap3
Protostar VM - Heap3
UTD Computer Security Group
 
Heap Base Exploitation
Heap Base ExploitationHeap Base Exploitation
Heap Base Exploitation
UTD Computer Security Group
 

More from UTD Computer Security Group (20)

Py jail talk
Py jail talkPy jail talk
Py jail talk
 
22S kickoff 2.0 (kickoff + anonymity talk)
22S kickoff 2.0 (kickoff + anonymity talk)22S kickoff 2.0 (kickoff + anonymity talk)
22S kickoff 2.0 (kickoff + anonymity talk)
 
Cloud talk
Cloud talkCloud talk
Cloud talk
 
UTD Computer Security Group - Cracking the domain
UTD Computer Security Group - Cracking the domainUTD Computer Security Group - Cracking the domain
UTD Computer Security Group - Cracking the domain
 
Forensics audio and video
Forensics   audio and videoForensics   audio and video
Forensics audio and video
 
Computer networks and network security
Computer networks and network securityComputer networks and network security
Computer networks and network security
 
Intro to python
Intro to pythonIntro to python
Intro to python
 
Powershell crash course
Powershell crash coursePowershell crash course
Powershell crash course
 
Intro to cybersecurity
Intro to cybersecurityIntro to cybersecurity
Intro to cybersecurity
 
Intro to Bash
Intro to BashIntro to Bash
Intro to Bash
 
Web Exploitation
Web ExploitationWeb Exploitation
Web Exploitation
 
Network Exploitation
Network ExploitationNetwork Exploitation
Network Exploitation
 
Penetration Testing: Celestial
Penetration Testing: CelestialPenetration Testing: Celestial
Penetration Testing: Celestial
 
Introduction to Exploitation
Introduction to ExploitationIntroduction to Exploitation
Introduction to Exploitation
 
Cryptography Crash Course
Cryptography Crash CourseCryptography Crash Course
Cryptography Crash Course
 
Fuzzing - Part 2
Fuzzing - Part 2Fuzzing - Part 2
Fuzzing - Part 2
 
Exploitation Crash Course
Exploitation Crash CourseExploitation Crash Course
Exploitation Crash Course
 
Fuzzing - Part 1
Fuzzing - Part 1Fuzzing - Part 1
Fuzzing - Part 1
 
Protostar VM - Heap3
Protostar VM - Heap3Protostar VM - Heap3
Protostar VM - Heap3
 
Heap Base Exploitation
Heap Base ExploitationHeap Base Exploitation
Heap Base Exploitation
 

Recently uploaded

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Asymmetric Cryptography

  • 2. Why Cryptography? ● Confidentiality - only intended parties can read contents ● Integrity - message tampering can be detected ● Authentication - the author is verified ● Nonrepudiation - the author cannot deny being the author
  • 3. Why asymmetric cryptography? ● No need to secretly distribute key ● Difficult to brute-force ● Reuse of key does not significantly weaken security
  • 4. Why not asymmetric cryptography? ● More computationally-intensive than symmetric cryptography
  • 5. RSA ● Developed by Rivest, Shamir, and Adleman in 1977 ● Based on the difficulty of factoring product of 2 large primes, being able to compute private key from public key ● Built-in confidentiality, authentication, integrity, and nonrepudiation from owner ● Computationally expensive
  • 6. RSA Keys ● Public and private key should be prime numbers ≥ 2048 bits ● Public key should be available to everyone ○ Ex) Distribute using keyserver ● Private key should be known only to the owner of key pair
  • 8. RSA Key Generation 1. Pick primes of similar length (p = 61, q = 53) 2. Compute N as p x q (61 x 53 = 3233) 3. Compute the totient of N (60 x 52 = 3120) 4. Chose public exponent e that is coprime to N (17) 5. Compute the modular multiplicative inverse of e mod totient(N) (2753)
  • 9. RSA Encryption ● e(m) = me mod N = c ● d(c) = cd mod N = m Because: ● d(me ) = med mod N = m -- ed = 1 + hφ(n) (Definition of multiplicative inverse) ● m1 + hφ(n) mod N = m ● m(mφ(n) )h mod N = m -- aφ(n) = 1 mod N (Euler’s Theorem) ● m(1)h mod N = m
  • 10. Uses for RSA ● First connection in SSL/TLS ● Signing communication ○ More efficient to encrypt hash of message rather than whole message ● Subscription-based services like commercial TV, radio, etc.
  • 11. Diffie-Hellman Key Exchange ● Developed and published by Whitfield Diffie and Martin Hellman in 1976 ● Relies on difficulty of discrete logarithm problem ● Forward secrecy ● Can be performed with more than two parties ● More efficient than RSA
  • 12. Diffie-Hellman Keys ● Communicating parties agree on a exponential base (g) and prime modulus (p) ● Each communicating party generates a secret value to use for exponentiation ● Shared symmetric key can be generated securely over public network ○ Negotiation steps, if captured, should not give away key
  • 13.
  • 15. Diffie Hellman Key Exchange 1. Alice and Bob agree on p = 23 and g = 5 (which is primitive root mod 23) 2. Alice chooses a = 6, and sends Bob A = 56 mod 23 = 8 3. Bob chooses b = 15, and sends Alice B = 515 mod 23 = 19 4. S = Ab mod p = 815 mod 23 = 2 5. S = Ba mod p = 196 mod 23 = 2
  • 16. Uses for Diffie-Hellman ● Key negotiation over public or unsecured channels (especially Ephemeral Diffie-Hellman) ○ Part of SSL/TLS ○ IPSec/VPN ○ SSH
  • 17. Attacks on Public Key Cryptography
  • 18. Timeline of “Modern” Cryptography Post World War II - Cryptography is regulated as munitions (can’t be exported) 1975 - DES Published 1976 - Diffie-Hellman Key Exchange published 1977 - RSA published 1977 - DES Standardized (FIPS) 1985 - Amiga 1000 released 1989 - Public commercial use of the internet 1991 - PGP Released (First major instance of personal cryptography) 1993 - PGP finds it way out of the United States 1996 - Bernstein v. United States (Cryptography Export laws) 1996 - SSLv3 released (containing export grade cryptography)
  • 19.
  • 20. Factoring RSA Export Keys ● FREAK ● March 3, 2015 ● CVE-2015-0204 ● Capitalizes on forcing the server to use RSA_EXPORT keys ● RSA_EXPORT Keys are 512 bits or less ● RSA_EXPORT keys were designed to be a backdoor, good enough for public use, bad enough for the NSA to be able to break if needed ● 9.6% of top million domains vulnerable
  • 21. Factoring RSA Export Keys ● Man in the Middle attack that requests RSA_EXPORT keys ● Most servers just go with it ● Most clients just go with it ● Generally one RSA_EXPORT key per server ● As seen in the diagram, knowing the premaster secret breaks the session
  • 22. CADO-NFS ● Implementation of Number Field Sieve ● Current fastest way to factor large numbers ● Current fastest way to compute discrete logarithm ● Can break 512 bit RSA keys in 7 hours for ~$100 on EC2
  • 23.
  • 24. Logjam ● October 2015 ● CVE-2015-4000 ● Capitalizes on forcing the server to use DHE_EXPORT parameters ● Tricks the client into thinking they are standard DHE ● 8.4% of the top million domains vulnerable
  • 25.
  • 26. Number Field Sieve for Discrete Log
  • 27. “Mining your P’s and Q’s” ● Low entropy RSA keys may share a common prime ● This prime can be found trivially with Euclid’s GCD Algorithm ● Finding one prime makes the other trivial to find, making generating a private key trivial to find
  • 28. Euclidean Algorithm for GCD function gcd(a, b) while b ≠ 0 t := b; b := a mod b; a := t; return a;
  • 29. More Resources: ● https://www.id0-rsa.pub/ - Cryptography Challenges ● https://www.youtube.com/watch?v=2aHkqB2-46k - Cryptography Lectures ● https://weakdh.org - Logjam Website ● https://mitls.org/pages/attacks/SMACK#freak - Freak Website ● https://factorable.net/ - Mining your P’s and Q’s ● https://github.com/kulinacs/smashcipher - Factor RSA library
  • 31. Future Events ● Introduction to Pentesting - Saturday, February 11th, 12 PM - 3 PM ● Coming up in March: Binary Exploitation ● CTFs for the semester (subject to change): ○ Boston Key Party (February 25th & 26th) ○ VolgaCTF (March 24th - 26th) ○ ASIS CTF (April 7th - 9th)