SlideShare a Scribd company logo
For the beginners, by a beginner
 Security Enthusiast
 Broke lock of my own bag.
 Start many things, finish nothing (mostly)
 Threat Researcher @ Symantec
 B&B
 Talking at badboy16a@gmail.com
 Broadcasting @_badbot
Functionality
Systems
 Encoding
 Encryption
 Obfuscation
 Cryptography
 Cryptanalysis
 Steganography
 Transposition
 scytale
 Substitution
 Caesar cipher
 Enigma
 Shannon’s law of secrecy
 PGP
Basics of Cryptography
Basics of Cryptography
Basics of Cryptography
Basics of Cryptography
Basics of Cryptography
Basics of Cryptography
 Messages is split in to fixed size blocks.
Block
Encryption
 Electronic CodeBook (ECB)
 Cipher Block Chaining (CBC)
 Cipher FeedBack(CFB)
 Output Feedback(OFB)
 Counter (CTR)
 Galois Counter Mode (GCM)
 Required to align data to Block length.
 Bit Padding
 Byte Padding
 Zero Padding
 ANSIx.923
 ISO-10126
 PKCS#7
 ISO/IEC 7816-4
 One way function.
 Arbitrary length input, fixed length output.
 Examples:
 CRC(16/32)
 MD(4/5)
 SHA(1/2/3/4)
 Integers
 Prime
 Co-prime
 Modulus
 Congruenc
e
 Group
 Modulus (M)
 Operation
 Identity
 Inverse
 Generator
 Ring
 Order (M-1)
iff M is
prime.
 Diffie-Hellman Key Exchange
 Alice and Bob agree to use a
modulus p = 23 and
generator g = 5.
 Alice chooses a secret
integer a = 6, then sends
Bob A = ga mod p
 A = 56 mod 23 = 8
 Bob chooses a secret
integer b = 15, then sends
Alice B = gb mod p
 B = 515 mod 23 = 19
 Alice computes s = Ba mod p
 s = 196 mod 23 = 2
 Bob computes s = Ab mod p
 s = 815 mod 23 = 2
 Alice and Bob now share a secret
(the number 2).
 Based on intractability principle
 Multiplying two large integers is easy
 Finding prime factors of large integers is an intractable problem.
 Computations are performed in “Group” modulo M.
 M being a very large prime.
 2 keys are generated simultaneously.
 Inverse of each other (modulo M).
 One encrypts (Public Key)
 Other decrypts (Private Key)
Encryption (P=5)
C = Pe
mod n 53 % 33 = 125 % 3 = 26
Decryption
P = Cd mod n 267 % 33 = 8031810176 % 33 = 5 OR
267 % 33 = 26 (3+3+1) % 33 = (263%33)* (263%33)* (26%33) = 5
Key Generation
Select 2 primes: p,q p = 11, q = 3
Calculate: n = p*q n = 33
Calculate: Φ(n) = (p-1)*(q-1) Φ(n) = 20
Choose e : gcd(e, Φ(n)) = 1, (e,n) is public key e = 3; Kpub = (3,33)
Find d : e*d = 1 mod Φ(n), (d,n) is private key d = 7, Kpriv = (7,33)
Basics of Cryptography
Basics of Cryptography
Basics of Cryptography
Basics of Cryptography
Basics of Cryptography

More Related Content

Viewers also liked (6)

PPTX
Nmap and metasploitable
Mohammed Akbar Shariff
 
PDF
A Strategic Path from Secure Code Reviews to Threat Modeling (101)
Deepam Kanjani
 
PPSX
Bit squatting
Avradeep Bhattacharya
 
PDF
Networking basics by rahul at Null Mumbai
Avkash Kathiriya
 
PDF
Yet another talk on bug bounty
vinoth kumar
 
PPTX
Metasploit framwork
Deepanshu Gajbhiye
 
Nmap and metasploitable
Mohammed Akbar Shariff
 
A Strategic Path from Secure Code Reviews to Threat Modeling (101)
Deepam Kanjani
 
Bit squatting
Avradeep Bhattacharya
 
Networking basics by rahul at Null Mumbai
Avkash Kathiriya
 
Yet another talk on bug bounty
vinoth kumar
 
Metasploit framwork
Deepanshu Gajbhiye
 

Similar to Basics of Cryptography (20)

PDF
IHE-Columbia-Theory- diploma Seminar.pdf
catanonymous47
 
PDF
Detailed cryptographic analysis of contact tracing protocols
Christian Spolaore
 
PDF
[Slides] A simple (leveled) fully homomorphic encryption scheme and thoughts ...
tranminhkhoait
 
PPT
crypto.ppt
Ganesh Chavan
 
PPT
crypto1.ppt
tommychauhan
 
PPT
introduction to cryptography (basics of it)
neonaveen
 
PPT
needed.ppt
faizalkhan673954
 
PPTX
6-PKCpartII-Encryptionandsignatures.pptx
farouqalfuhidi
 
PPTX
Paillier Cryptosystem
Dejan Radic
 
DOCX
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docx
wellesleyterresa
 
PPT
introduction to cryptography
Priyamvada Singh
 
PPTX
Al-Gamal-W6(al gamal)-d1-d2
Fahad Layth
 
PPTX
Digital signature
Coders Hub
 
PPTX
Information and data security other public key cryptosystems
Mazin Alwaaly
 
PDF
Public-Key Cryptography.pdfWrite the result of the following operation with t...
FahmiOlayah
 
PDF
Cryptography 202
UTD Computer Security Group
 
PPT
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin Jani
 
PPT
Elliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Information Security Awareness Group
 
PPTX
Cryptography in discrete structure .pptx
ayeshaimtiaz067
 
PDF
cp467_12_lecture14_image compression1.pdf
shaikmoosa2003
 
IHE-Columbia-Theory- diploma Seminar.pdf
catanonymous47
 
Detailed cryptographic analysis of contact tracing protocols
Christian Spolaore
 
[Slides] A simple (leveled) fully homomorphic encryption scheme and thoughts ...
tranminhkhoait
 
crypto.ppt
Ganesh Chavan
 
crypto1.ppt
tommychauhan
 
introduction to cryptography (basics of it)
neonaveen
 
needed.ppt
faizalkhan673954
 
6-PKCpartII-Encryptionandsignatures.pptx
farouqalfuhidi
 
Paillier Cryptosystem
Dejan Radic
 
HW 5-RSAascii2str.mfunction str = ascii2str(ascii) .docx
wellesleyterresa
 
introduction to cryptography
Priyamvada Singh
 
Al-Gamal-W6(al gamal)-d1-d2
Fahad Layth
 
Digital signature
Coders Hub
 
Information and data security other public key cryptosystems
Mazin Alwaaly
 
Public-Key Cryptography.pdfWrite the result of the following operation with t...
FahmiOlayah
 
Cryptography 202
UTD Computer Security Group
 
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin Jani
 
Elliptic curvecryptography Shane Almeida Saqib Awan Dan Palacio
Information Security Awareness Group
 
Cryptography in discrete structure .pptx
ayeshaimtiaz067
 
cp467_12_lecture14_image compression1.pdf
shaikmoosa2003
 
Ad

More from Sunil Kumar (7)

PPTX
3Es of Ransomware
Sunil Kumar
 
PPTX
Http2 Security Perspective
Sunil Kumar
 
PPTX
Memory forensics
Sunil Kumar
 
PPTX
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
Sunil Kumar
 
PPTX
Jsonp null-meet-02-2015
Sunil Kumar
 
PPTX
Dt5 varenni win_pcapdosdonts
Sunil Kumar
 
PDF
Nullcon 2011- Behaviour Analysis with DBI
Sunil Kumar
 
3Es of Ransomware
Sunil Kumar
 
Http2 Security Perspective
Sunil Kumar
 
Memory forensics
Sunil Kumar
 
n|u Dharamsala Humla : Memory Forensic by Tenzin Chokden
Sunil Kumar
 
Jsonp null-meet-02-2015
Sunil Kumar
 
Dt5 varenni win_pcapdosdonts
Sunil Kumar
 
Nullcon 2011- Behaviour Analysis with DBI
Sunil Kumar
 
Ad

Recently uploaded (20)

PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
PDF
Enhancing Security in VAST: Towards Static Vulnerability Scanning
ESUG
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
PDF
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PPT
Brief History of Python by Learning Python in three hours
adanechb21
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
PDF
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
 
PDF
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PDF
Virtual Threads in Java: A New Dimension of Scalability and Performance
Tier1 app
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
Enhancing Security in VAST: Towards Static Vulnerability Scanning
ESUG
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
How to Download and Install ADT (ABAP Development Tools) for Eclipse IDE | SA...
SAP Vista, an A L T Z E N Company
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
Brief History of Python by Learning Python in three hours
adanechb21
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
 
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
WatchTraderHub - Watch Dealer software with inventory management and multi-ch...
WatchDealer Pavel
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
Virtual Threads in Java: A New Dimension of Scalability and Performance
Tier1 app
 

Basics of Cryptography

  • 1. For the beginners, by a beginner
  • 2.  Security Enthusiast  Broke lock of my own bag.  Start many things, finish nothing (mostly)  Threat Researcher @ Symantec  B&B  Talking at [email protected]  Broadcasting @_badbot
  • 4.  Encoding  Encryption  Obfuscation  Cryptography  Cryptanalysis  Steganography
  • 5.  Transposition  scytale  Substitution  Caesar cipher  Enigma  Shannon’s law of secrecy  PGP
  • 12.  Messages is split in to fixed size blocks.
  • 14.  Electronic CodeBook (ECB)  Cipher Block Chaining (CBC)  Cipher FeedBack(CFB)  Output Feedback(OFB)  Counter (CTR)  Galois Counter Mode (GCM)
  • 15.  Required to align data to Block length.  Bit Padding  Byte Padding  Zero Padding  ANSIx.923  ISO-10126  PKCS#7  ISO/IEC 7816-4
  • 16.  One way function.  Arbitrary length input, fixed length output.  Examples:  CRC(16/32)  MD(4/5)  SHA(1/2/3/4)
  • 17.  Integers  Prime  Co-prime  Modulus  Congruenc e  Group  Modulus (M)  Operation  Identity  Inverse  Generator  Ring  Order (M-1) iff M is prime.
  • 18.  Diffie-Hellman Key Exchange  Alice and Bob agree to use a modulus p = 23 and generator g = 5.  Alice chooses a secret integer a = 6, then sends Bob A = ga mod p  A = 56 mod 23 = 8  Bob chooses a secret integer b = 15, then sends Alice B = gb mod p  B = 515 mod 23 = 19  Alice computes s = Ba mod p  s = 196 mod 23 = 2  Bob computes s = Ab mod p  s = 815 mod 23 = 2  Alice and Bob now share a secret (the number 2).
  • 19.  Based on intractability principle  Multiplying two large integers is easy  Finding prime factors of large integers is an intractable problem.  Computations are performed in “Group” modulo M.  M being a very large prime.  2 keys are generated simultaneously.  Inverse of each other (modulo M).  One encrypts (Public Key)  Other decrypts (Private Key)
  • 20. Encryption (P=5) C = Pe mod n 53 % 33 = 125 % 3 = 26 Decryption P = Cd mod n 267 % 33 = 8031810176 % 33 = 5 OR 267 % 33 = 26 (3+3+1) % 33 = (263%33)* (263%33)* (26%33) = 5 Key Generation Select 2 primes: p,q p = 11, q = 3 Calculate: n = p*q n = 33 Calculate: Φ(n) = (p-1)*(q-1) Φ(n) = 20 Choose e : gcd(e, Φ(n)) = 1, (e,n) is public key e = 3; Kpub = (3,33) Find d : e*d = 1 mod Φ(n), (d,n) is private key d = 7, Kpriv = (7,33)

Editor's Notes

  • #6: PGP Later
  • #7: https://www.digicert.com/images/iot/IoTSecuritySolutionGraphic_400x400.png
  • #9: DES: by IBM, Lucifer, NSA? Why not 2DES? Meet-in-the-middle
  • #10: Symmetric key must be shared before use.
  • #11: Encrypts one bit/byte. Perfect: One Time Pad
  • #12: Linear Feedback Shift Register Designed to be implemented in H/W (A5/1), CSS Initial State, Key, Tap Points
  • #13: DES Block size: 64 bits, Keysize: 56b (+8b parity) AES Block Size: 64 bits, Key size: 64, 128, 256
  • #15: GCM provides authentication also.
  • #16: Must be identifiable after decryption Ciphertext Stealing
  • #17: SHAttered Fuzzy hashing.
  • #18: Primality Test Multiplicative Group
  • #20: Multiplicative group
  • #21: RSA?? Extended Euclid,s Algorithm e is small, usually 65537.
  • #24: Trust = Sign their public key.
  • #26: The Irony