SlideShare una empresa de Scribd logo
1 de 36
CRYPTOGRAPHY - 101

      VISHAL PUNJABI
    vp0502@gmail.com
OVERVIEW
• Terminologies
• Symmetric key algorithms
      -Vernam cipher
      -A5/1
      -DES
      -AES
• Asymmetric key algorithms
      -RSA
      -Deffie Hellman
• Some cryptographic hashes
• Tools for cryptanalysis
TERMINOLOGY
• Cryptology-Art and science of making
  “secret codes”.
• Cryptography- The practice and study
  of hiding information.
• Cryptanalysis-Art of finding some
  weakness and insecurity in a
  cryptographic scheme.
CRYPTOGRAPHIC TERMINOLOGY

• Plain text-The format of the data before being
  encrypted.
• Cipher Text-The “scrambled” format of data after
  being encrypted.
• Key-A secret value used during the encryption
  and decryption process
• Encryption-Method of transforming plain text into
  an unreadable format
• Decryption-Method of obtaining the encrypted
  message back to its original form.
ENCRYPTION AND DECRYPTION
TYPES OF ALGORITHMS
           Cryptographic algorithms




Symmetric key                 Asymmetric key
(Shared secret key)           (Public key)
SYMMETRIC KEY ENCRYPTION
TYPES OF SYMMETRIC CIPHERS
• Stream ciphers
  – Encrypts one bit/character at a time
• Block ciphers
  – Break plaintext message in equal-size
    blocks
  – Encrypts each block as a unit
SUBSTITUTION CIPHER
•  Substituting by a character “key” places ahead of the current
   character
a)Monoalphabetic cipher (Stream cipher)
•  Eg. PlainText : THIS IS AN EASY TASK
• Key : 3
• Encryption : WKLV LV DQ HDVB WDVN


b) Polyalphabetic cipher (Block cipher)
•   Eg : THIS IS AN EASY TASK.
•   Make group of 3 characters and a set of keys used could be 135.
                   THI SIS ANE…
                   Encryption : UKN TLX…
TRANSPOSITION CIPHER
•   Transposition ciphers use the letters of the plaintext
    message, but they permute the order of the letters.

Encrypt :  hello my dear friend
Key: 2143
1. Remove spaces
2. Divide the text into blocks of 4 characters.
3. Add bogus character(s) at the end(if reqiured).

                              hello myde arfr iend
Ciphertext:                   ehol ymed rarf eidn
After decryption :            hello myde arfr iend
VERNAM CIPHER
•   Each character from the plaintext is encrypted by a modular addition
    which a number from the secret random key pad which is of the
    same length as the plain text.

Step 1: Convert the letters to their numeric equivalents
          V E R N A M C I P H E R
          21 4 17 13 0 12 2 8 15 7 4 17

Assume the random 2 digit no. series (key)
         76 48 16 82 44 03 58 11 60 05 10 88
Step 2: Add the numeric equivalent and the corresponding
   random no.
         Random no + numeric equivalent =sum

Sum 97 52 33 95 44 15 60 19 75 12 14 105
VERNAM CIPHER
Step 3 : Perform sum mod 26
                  19 0 7 17 18 15 8 19 23 12 14 1
Ciphertext ----
                  t a h r s p i t x m o b

Decryption
Step 1
 a =     (numeric equivalent of ciphertext - key)
Step 2
a mod 26
(if a negative then keep adding 26 till you get a positive no.)
Step 3
Convert numeric equivalent back to alphabet
A5/1 STREAM CIPHER
• GSM uses A5/1 as a cryptographic
  algorithm.
• Phone communication in GSM is done
  as a sequence of 228 bit frames.
• A5/1 creates a bit stream of 228 bits in
  a 228 bit buffer which is EX-Ored with
  228 bits of plain text to generate the
  ciphertext.
A5/1 STREAM CIPHER
A5/1 STREAM CIPHER
• It was initially kept secret, but became
  public knowledge through leaks
  and reverse engineering.

• COPACOBANA was the first
  commercially available solution to
  break the cipher.
RC4 STREAM CIPHER
• Most widely used stream cipher used in
  popular protocols such as Secure
  Sockets Layer (SSL) (to protect Internet
  traffic) and WEP (to secure wireless
  networks).
• Designed by Ron Rivest in 1984.
• Hence the name RC4( Rivest cipher 4).
• Fluhrer, Mantin and Shamir attack AND
  Klein's Attack are a few attempts.
RC4 STREAM CIPHER
• Consists of 2 parts: Key Scheduling
  Algorithm (KSA) & Pseudo-Random
  Generation Algorithm
• 8 bits of the plain text is Exored with a
  byte of the key to produce a byte of
  ciphertext.
• Key stream is a a sequence of bytes(
  can contain 1-256 bytes).
DATA ENCRYPTION
       STANDARD (DES)
• Modern symmetric key block cipher.
• Developed by IBM and then published
  by National Institute of standards and
  technology(NIST).
• Vulnerable only because of its small
  key length.
• Often used in VPN servers.
DES ALGORITHM
• DES is a Feistel cipher
   –   64 bit block length
   –   56 bit key length
   –   16 rounds
   –   48 bits of key used each
       round (subkey)
• Each round is simple
  (for a block cipher)
• Security depends
  primarily on “S-boxes”
   – Each S-boxes maps 6 bits
     to 4 bits
L     R                        key

           32             28               28

     expand           shift                shift         One
           48                  28     28
                                                        Round
32              Ki

                48
                                                          of
           48                  compress

     S-boxes
                     28                            28    DES
           32

      P box
32
           32

           32
                                key
 L     R
DES ATTACKS
• Brute force attack
• Differential cryptanalysis
• Linear cryptanalysis
• Improved Davies' attack
• distributed.net and the Electronic Frontier
  Foundation collaborated to publicly
  break a DES key in 22 hours and 15
  minutes
• Now replaced by AES
ADVANCED ENCRYPTION STANDARD
           (AES)
•   Replacement for DES
•   AES competition (late 90’s)
     – NSA openly involved
     – Transparent process
     – Many strong algorithms proposed
     – Rijndael Algorithm ultimately selected
•   Iterated block cipher (like DES)
•   Not a Feistel cipher (unlike DES)
•   3 versions are :   AES - 128
                        AES - 192
                       AES – 256
•   Used in Open SSL and WPA2
AES OVERVIEW
•   Block size: 128, 192 or 256 bits
•   Key length: 128, 192 or 256
    bits (independent of block
    size)
•   10 to 14 rounds (depends on
    key length)
•   Each round uses 4 functions
    (in 3 “layers”)
      – ByteSub (nonlinear layer)
      – ShiftRow (linear mixing
         layer)
      – MixColumn (nonlinear
         layer)
      – AddRoundKey (key
         addition layer)
ATTACKS
•   Side-channel attack
•   Brute force attack
•   XSL attack
•   Related-key attack
•    Known-key distinguishing attack
ASYMMETRIC KEY ENCRYPTION
RSA
• The most common public-key algorithm is the RSA
  cryptosystem, named for its inventors (Rivest, Shamir, and
  Adleman).
• Applications
1. To protect web traffic, in the SSL protocol (Security
   Socket Layer),
2. To guarantee email privacy and authenticity in PGP
   (Pretty Good Privacy)
3. To guarantee remote connection in SSH (Secure Shell)
4. Furthermore it plays an important role in the modern
   payment systems through SET protocol (Secure
   Electronic Transaction).
ALGORITHM
•   Let p and q be two large prime numbers
•   Let N = pq be the modulus
•   Find ф(n)=(p-1).(q-1)
•   Choose e such that it is relatively prime to ф(n).
•   Choose d such that :      e x d mod ф(n)=1
•   Public key is (N,e)
•   Private key is d
• To encrypt message M compute
    – C = Me mod N
• To decrypt C compute
    – M = Cd mod N
RSA ATTACKS
• Factoring the Public Key
  To make RSA secure recommended
  size of p and q is 512 bits(154 decimal
  digits).
  This makes n 1024 bits.
• Guessing d
• Cycle Attack
• Common Modulus
Diffie Hellman
• Invented by Williamson (GCHQ) and,
  independently, by D and H (Stanford)
• A “key exchange” algorithm
  – Used to establish a shared symmetric key
 - Not for encrypting or signing but for
 exchanging keys.
1. P is very large prime no and g is its primitive root.
2. Alice chooses a large random no. x such that 0<= x <= p-1 and calculates
   R1= gx mod p.
3. Bob chooses another large random no. y such that 0<= y <= p-1 and
   calculates R2=gy mod p.
4. Alice sends R1 to Bob. Alice does not send x; she only sends R1.
5. Bob sends R2 to Alice. Bob does not send y; he only sends R2.
6. Alice calculates K= (R2)x mod p.
7. Bob calculates K= (R1)y mod p.
ATTACKS
1. Discrete logarithm attack
   Intruder can intercept R1 and R2. If
   he can find x from R1=gx mod p and
   y from R2=gy mod p then he can
   calculate k=gxy mod p
2. Man in the middle attack.
SOME CRYPTOGRAPHIC HASHES
a) MD5(Message Digest 5)
• Developed by Ron Rivest of MIT.
• Was the mostly used secure hash algorithm till
  it was cracked.
• Takes an input msg of arbitrary length and
  produces as output a 128-bit message digest.
• The input is processed in 512-bit block.
• Attacks possible on MD5 are Bruteforce and
  Fast collision attacks.
SOME CRYPTOGRAPHIC HASHES
b) SHA-1(Secure hash algorithm)
• Developed by NIST(National Institute of
  standards and technology).
SHA-1 Logic :
• The algorithm takes as input a message with a
  maximum length of less than 264 bits and
  produces a 160-bit message digest.
• The input is processed in 512-bit blocks.
TOOLS FOR CRYPTANALYSTS
• Ganzúa-A cryptanalysis tool for
  classical ciphers
• EverCrack - Open Source
  Cryptanalysis Engine
• Lepton's Crack
• Online crackers
SOME RESOURCES
• CRYPTOGRAPHY CLASS BY STANFORD
      http://www.crypto-class.org/

• Awesome videos
       http://www.intypedia.com/

• CRYPTOGRAPHY AND NETWORK SECURITY
        -BEHEROUZ A FOROUZAN
THANK YOU
    

Más contenido relacionado

La actualidad más candente

block ciphers
block ciphersblock ciphers
block ciphersAsad Ali
 
2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream CiphersSam Bowne
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithmsRashmi Burugupalli
 
Cryptography Fundamentals
Cryptography FundamentalsCryptography Fundamentals
Cryptography FundamentalsDuy Do Phan
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network SecurityPa Van Tanku
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network SecurityKathirvel Ayyaswamy
 
CRYPTOGRAPHY & NETWORK SECURITY - unit 1
CRYPTOGRAPHY & NETWORK SECURITY -  unit 1CRYPTOGRAPHY & NETWORK SECURITY -  unit 1
CRYPTOGRAPHY & NETWORK SECURITY - unit 1RAMESHBABU311293
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographyPopescu Petre
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniquesJanani S
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptographyzahid-mian
 
Topic1 substitution transposition-techniques
Topic1 substitution transposition-techniquesTopic1 substitution transposition-techniques
Topic1 substitution transposition-techniquesMdFazleRabbi18
 

La actualidad más candente (20)

block ciphers
block ciphersblock ciphers
block ciphers
 
2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream Ciphers
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
Cryptography Fundamentals
Cryptography FundamentalsCryptography Fundamentals
Cryptography Fundamentals
 
Cryptography and Network Security
Cryptography and Network SecurityCryptography and Network Security
Cryptography and Network Security
 
cryptography
cryptographycryptography
cryptography
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
CRYPTOGRAPHY & NETWORK SECURITY - unit 1
CRYPTOGRAPHY & NETWORK SECURITY -  unit 1CRYPTOGRAPHY & NETWORK SECURITY -  unit 1
CRYPTOGRAPHY & NETWORK SECURITY - unit 1
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
 
Topic1 substitution transposition-techniques
Topic1 substitution transposition-techniquesTopic1 substitution transposition-techniques
Topic1 substitution transposition-techniques
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
MD-5 : Algorithm
MD-5 : AlgorithmMD-5 : Algorithm
MD-5 : Algorithm
 
Cryptography
CryptographyCryptography
Cryptography
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 

Destacado

Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and CryptographyAdam Reagan
 
Cryptography 101
Cryptography 101 Cryptography 101
Cryptography 101 Andy Fisher
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption StandardPrince Rachit
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hackingtozsuer
 
Evaluation of mininet WiFi integration via ns-3
Evaluation of mininet WiFi integration via ns-3Evaluation of mininet WiFi integration via ns-3
Evaluation of mininet WiFi integration via ns-3Farzaneh Pakzad
 
Digital signatures
Digital signaturesDigital signatures
Digital signaturesSanoj Kumar
 
My tech timeline
My tech timelineMy tech timeline
My tech timelinedakota97
 
2012 06-19 --ncc_group_-_iet_seminar_-_mobile_apps_and_secure_by_design
2012 06-19 --ncc_group_-_iet_seminar_-_mobile_apps_and_secure_by_design2012 06-19 --ncc_group_-_iet_seminar_-_mobile_apps_and_secure_by_design
2012 06-19 --ncc_group_-_iet_seminar_-_mobile_apps_and_secure_by_designNCC Group
 
2013 07-12 ncc-group_data_anonymisation_technical_aspects_v1 0
2013 07-12 ncc-group_data_anonymisation_technical_aspects_v1 02013 07-12 ncc-group_data_anonymisation_technical_aspects_v1 0
2013 07-12 ncc-group_data_anonymisation_technical_aspects_v1 0NCC Group
 
Practical SME Security on a Shoestring
Practical SME Security on a ShoestringPractical SME Security on a Shoestring
Practical SME Security on a ShoestringNCC Group
 
How we breach small and medium enterprises (SMEs)
How we breach small and medium enterprises (SMEs)How we breach small and medium enterprises (SMEs)
How we breach small and medium enterprises (SMEs)NCC Group
 
Pki 202 Architechture Models and CRLs
Pki 202   Architechture Models and CRLsPki 202   Architechture Models and CRLs
Pki 202 Architechture Models and CRLsNCC Group
 
Mobile App Security: Enterprise Checklist
Mobile App Security: Enterprise ChecklistMobile App Security: Enterprise Checklist
Mobile App Security: Enterprise ChecklistJignesh Solanki
 
Exploiting appliances presentation v1.1-vids-removed
Exploiting appliances   presentation  v1.1-vids-removedExploiting appliances   presentation  v1.1-vids-removed
Exploiting appliances presentation v1.1-vids-removedNCC Group
 
Storage on cloud using dynamic encryption
Storage on cloud using dynamic encryptionStorage on cloud using dynamic encryption
Storage on cloud using dynamic encryptionMphasis
 
Classification of secure encrypted relationaldata in cloud computing
Classification of secure encrypted relationaldata in cloud computingClassification of secure encrypted relationaldata in cloud computing
Classification of secure encrypted relationaldata in cloud computingeSAT Journals
 

Destacado (20)

Cryptography
CryptographyCryptography
Cryptography
 
Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and Cryptography
 
Cryptography 101
Cryptography 101 Cryptography 101
Cryptography 101
 
Ch08
Ch08Ch08
Ch08
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption Standard
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Ethical hacking
Ethical hackingEthical hacking
Ethical hacking
 
Evaluation of mininet WiFi integration via ns-3
Evaluation of mininet WiFi integration via ns-3Evaluation of mininet WiFi integration via ns-3
Evaluation of mininet WiFi integration via ns-3
 
Digital signatures
Digital signaturesDigital signatures
Digital signatures
 
My tech timeline
My tech timelineMy tech timeline
My tech timeline
 
2012 06-19 --ncc_group_-_iet_seminar_-_mobile_apps_and_secure_by_design
2012 06-19 --ncc_group_-_iet_seminar_-_mobile_apps_and_secure_by_design2012 06-19 --ncc_group_-_iet_seminar_-_mobile_apps_and_secure_by_design
2012 06-19 --ncc_group_-_iet_seminar_-_mobile_apps_and_secure_by_design
 
2013 07-12 ncc-group_data_anonymisation_technical_aspects_v1 0
2013 07-12 ncc-group_data_anonymisation_technical_aspects_v1 02013 07-12 ncc-group_data_anonymisation_technical_aspects_v1 0
2013 07-12 ncc-group_data_anonymisation_technical_aspects_v1 0
 
Practical SME Security on a Shoestring
Practical SME Security on a ShoestringPractical SME Security on a Shoestring
Practical SME Security on a Shoestring
 
How we breach small and medium enterprises (SMEs)
How we breach small and medium enterprises (SMEs)How we breach small and medium enterprises (SMEs)
How we breach small and medium enterprises (SMEs)
 
Pki 202 Architechture Models and CRLs
Pki 202   Architechture Models and CRLsPki 202   Architechture Models and CRLs
Pki 202 Architechture Models and CRLs
 
Mobile App Security: Enterprise Checklist
Mobile App Security: Enterprise ChecklistMobile App Security: Enterprise Checklist
Mobile App Security: Enterprise Checklist
 
Exploiting appliances presentation v1.1-vids-removed
Exploiting appliances   presentation  v1.1-vids-removedExploiting appliances   presentation  v1.1-vids-removed
Exploiting appliances presentation v1.1-vids-removed
 
Storage on cloud using dynamic encryption
Storage on cloud using dynamic encryptionStorage on cloud using dynamic encryption
Storage on cloud using dynamic encryption
 
Classification of secure encrypted relationaldata in cloud computing
Classification of secure encrypted relationaldata in cloud computingClassification of secure encrypted relationaldata in cloud computing
Classification of secure encrypted relationaldata in cloud computing
 

Similar a Cryptography - 101

Cybersecurity cyberlab3
Cybersecurity cyberlab3Cybersecurity cyberlab3
Cybersecurity cyberlab3rayborg
 
Cryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxCryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxRobertCarreonBula
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & SteganographyAnimesh Shaw
 
Overview on Cryptography and Network Security
Overview on Cryptography and Network SecurityOverview on Cryptography and Network Security
Overview on Cryptography and Network SecurityDr. Rupa Ch
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 
Trible data encryption standard (3DES)
Trible data encryption standard (3DES)Trible data encryption standard (3DES)
Trible data encryption standard (3DES)Ahmed Mohamed Mahmoud
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers Sam Bowne
 
Chapter 8 cryptography lanjutan
Chapter 8 cryptography lanjutanChapter 8 cryptography lanjutan
Chapter 8 cryptography lanjutannewbie2019
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
CH02-CompSec4e.pptx
CH02-CompSec4e.pptxCH02-CompSec4e.pptx
CH02-CompSec4e.pptxams1ams11
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersSam Bowne
 

Similar a Cryptography - 101 (20)

Cybersecurity cyberlab3
Cybersecurity cyberlab3Cybersecurity cyberlab3
Cybersecurity cyberlab3
 
Cryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptxCryptography and steganography lesson and discription.pptx
Cryptography and steganography lesson and discription.pptx
 
Cryptography & Steganography
Cryptography & SteganographyCryptography & Steganography
Cryptography & Steganography
 
Overview on Cryptography and Network Security
Overview on Cryptography and Network SecurityOverview on Cryptography and Network Security
Overview on Cryptography and Network Security
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 
1 DES.pdf
1 DES.pdf1 DES.pdf
1 DES.pdf
 
Trible data encryption standard (3DES)
Trible data encryption standard (3DES)Trible data encryption standard (3DES)
Trible data encryption standard (3DES)
 
4. Block Ciphers
4. Block Ciphers 4. Block Ciphers
4. Block Ciphers
 
section-8.ppt
section-8.pptsection-8.ppt
section-8.ppt
 
Common Crypto Pitfalls
Common Crypto PitfallsCommon Crypto Pitfalls
Common Crypto Pitfalls
 
Class3
Class3Class3
Class3
 
Chapter 8 cryptography lanjutan
Chapter 8 cryptography lanjutanChapter 8 cryptography lanjutan
Chapter 8 cryptography lanjutan
 
Modern Cryptography
Modern CryptographyModern Cryptography
Modern Cryptography
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
CH02-CompSec4e.pptx
CH02-CompSec4e.pptxCH02-CompSec4e.pptx
CH02-CompSec4e.pptx
 
Ch03
Ch03Ch03
Ch03
 
CNIT 141: 4. Block Ciphers
CNIT 141: 4. Block CiphersCNIT 141: 4. Block Ciphers
CNIT 141: 4. Block Ciphers
 

Más de n|u - The Open Security Community

Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...n|u - The Open Security Community
 

Más de n|u - The Open Security Community (20)

Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)
 
Osint primer
Osint primerOsint primer
Osint primer
 
SSRF exploit the trust relationship
SSRF exploit the trust relationshipSSRF exploit the trust relationship
SSRF exploit the trust relationship
 
Nmap basics
Nmap basicsNmap basics
Nmap basics
 
Metasploit primary
Metasploit primaryMetasploit primary
Metasploit primary
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Introduction to TLS 1.3
Introduction to TLS 1.3Introduction to TLS 1.3
Introduction to TLS 1.3
 
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
 
Talking About SSRF,CRLF
Talking About SSRF,CRLFTalking About SSRF,CRLF
Talking About SSRF,CRLF
 
Building active directory lab for red teaming
Building active directory lab for red teamingBuilding active directory lab for red teaming
Building active directory lab for red teaming
 
Owning a company through their logs
Owning a company through their logsOwning a company through their logs
Owning a company through their logs
 
Introduction to shodan
Introduction to shodanIntroduction to shodan
Introduction to shodan
 
Cloud security
Cloud security Cloud security
Cloud security
 
Detecting persistence in windows
Detecting persistence in windowsDetecting persistence in windows
Detecting persistence in windows
 
Frida - Objection Tool Usage
Frida - Objection Tool UsageFrida - Objection Tool Usage
Frida - Objection Tool Usage
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System ProcessOSQuery - Monitoring System Process
OSQuery - Monitoring System Process
 
DevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -SecurityDevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -Security
 
Extensible markup language attacks
Extensible markup language attacksExtensible markup language attacks
Extensible markup language attacks
 
Linux for hackers
Linux for hackersLinux for hackers
Linux for hackers
 
Android Pentesting
Android PentestingAndroid Pentesting
Android Pentesting
 

Último

Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024TopCSSGallery
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 

Último (20)

Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 

Cryptography - 101

  • 1. CRYPTOGRAPHY - 101 VISHAL PUNJABI vp0502@gmail.com
  • 2. OVERVIEW • Terminologies • Symmetric key algorithms -Vernam cipher -A5/1 -DES -AES • Asymmetric key algorithms -RSA -Deffie Hellman • Some cryptographic hashes • Tools for cryptanalysis
  • 3. TERMINOLOGY • Cryptology-Art and science of making “secret codes”. • Cryptography- The practice and study of hiding information. • Cryptanalysis-Art of finding some weakness and insecurity in a cryptographic scheme.
  • 4. CRYPTOGRAPHIC TERMINOLOGY • Plain text-The format of the data before being encrypted. • Cipher Text-The “scrambled” format of data after being encrypted. • Key-A secret value used during the encryption and decryption process • Encryption-Method of transforming plain text into an unreadable format • Decryption-Method of obtaining the encrypted message back to its original form.
  • 6. TYPES OF ALGORITHMS Cryptographic algorithms Symmetric key Asymmetric key (Shared secret key) (Public key)
  • 8. TYPES OF SYMMETRIC CIPHERS • Stream ciphers – Encrypts one bit/character at a time • Block ciphers – Break plaintext message in equal-size blocks – Encrypts each block as a unit
  • 9. SUBSTITUTION CIPHER • Substituting by a character “key” places ahead of the current character a)Monoalphabetic cipher (Stream cipher) • Eg. PlainText : THIS IS AN EASY TASK • Key : 3 • Encryption : WKLV LV DQ HDVB WDVN b) Polyalphabetic cipher (Block cipher) • Eg : THIS IS AN EASY TASK. • Make group of 3 characters and a set of keys used could be 135. THI SIS ANE… Encryption : UKN TLX…
  • 10. TRANSPOSITION CIPHER • Transposition ciphers use the letters of the plaintext message, but they permute the order of the letters. Encrypt : hello my dear friend Key: 2143 1. Remove spaces 2. Divide the text into blocks of 4 characters. 3. Add bogus character(s) at the end(if reqiured). hello myde arfr iend Ciphertext: ehol ymed rarf eidn After decryption : hello myde arfr iend
  • 11. VERNAM CIPHER • Each character from the plaintext is encrypted by a modular addition which a number from the secret random key pad which is of the same length as the plain text. Step 1: Convert the letters to their numeric equivalents V E R N A M C I P H E R 21 4 17 13 0 12 2 8 15 7 4 17 Assume the random 2 digit no. series (key) 76 48 16 82 44 03 58 11 60 05 10 88 Step 2: Add the numeric equivalent and the corresponding random no. Random no + numeric equivalent =sum Sum 97 52 33 95 44 15 60 19 75 12 14 105
  • 12. VERNAM CIPHER Step 3 : Perform sum mod 26 19 0 7 17 18 15 8 19 23 12 14 1 Ciphertext ---- t a h r s p i t x m o b Decryption Step 1 a = (numeric equivalent of ciphertext - key) Step 2 a mod 26 (if a negative then keep adding 26 till you get a positive no.) Step 3 Convert numeric equivalent back to alphabet
  • 13. A5/1 STREAM CIPHER • GSM uses A5/1 as a cryptographic algorithm. • Phone communication in GSM is done as a sequence of 228 bit frames. • A5/1 creates a bit stream of 228 bits in a 228 bit buffer which is EX-Ored with 228 bits of plain text to generate the ciphertext.
  • 15. A5/1 STREAM CIPHER • It was initially kept secret, but became public knowledge through leaks and reverse engineering. • COPACOBANA was the first commercially available solution to break the cipher.
  • 16. RC4 STREAM CIPHER • Most widely used stream cipher used in popular protocols such as Secure Sockets Layer (SSL) (to protect Internet traffic) and WEP (to secure wireless networks). • Designed by Ron Rivest in 1984. • Hence the name RC4( Rivest cipher 4). • Fluhrer, Mantin and Shamir attack AND Klein's Attack are a few attempts.
  • 17. RC4 STREAM CIPHER • Consists of 2 parts: Key Scheduling Algorithm (KSA) & Pseudo-Random Generation Algorithm • 8 bits of the plain text is Exored with a byte of the key to produce a byte of ciphertext. • Key stream is a a sequence of bytes( can contain 1-256 bytes).
  • 18. DATA ENCRYPTION STANDARD (DES) • Modern symmetric key block cipher. • Developed by IBM and then published by National Institute of standards and technology(NIST). • Vulnerable only because of its small key length. • Often used in VPN servers.
  • 19. DES ALGORITHM • DES is a Feistel cipher – 64 bit block length – 56 bit key length – 16 rounds – 48 bits of key used each round (subkey) • Each round is simple (for a block cipher) • Security depends primarily on “S-boxes” – Each S-boxes maps 6 bits to 4 bits
  • 20. L R key 32 28 28 expand shift shift One 48 28 28 Round 32 Ki 48 of 48 compress S-boxes 28 28 DES 32 P box 32 32 32 key L R
  • 21. DES ATTACKS • Brute force attack • Differential cryptanalysis • Linear cryptanalysis • Improved Davies' attack • distributed.net and the Electronic Frontier Foundation collaborated to publicly break a DES key in 22 hours and 15 minutes • Now replaced by AES
  • 22. ADVANCED ENCRYPTION STANDARD (AES) • Replacement for DES • AES competition (late 90’s) – NSA openly involved – Transparent process – Many strong algorithms proposed – Rijndael Algorithm ultimately selected • Iterated block cipher (like DES) • Not a Feistel cipher (unlike DES) • 3 versions are : AES - 128 AES - 192 AES – 256 • Used in Open SSL and WPA2
  • 23. AES OVERVIEW • Block size: 128, 192 or 256 bits • Key length: 128, 192 or 256 bits (independent of block size) • 10 to 14 rounds (depends on key length) • Each round uses 4 functions (in 3 “layers”) – ByteSub (nonlinear layer) – ShiftRow (linear mixing layer) – MixColumn (nonlinear layer) – AddRoundKey (key addition layer)
  • 24. ATTACKS • Side-channel attack • Brute force attack • XSL attack • Related-key attack • Known-key distinguishing attack
  • 26. RSA • The most common public-key algorithm is the RSA cryptosystem, named for its inventors (Rivest, Shamir, and Adleman). • Applications 1. To protect web traffic, in the SSL protocol (Security Socket Layer), 2. To guarantee email privacy and authenticity in PGP (Pretty Good Privacy) 3. To guarantee remote connection in SSH (Secure Shell) 4. Furthermore it plays an important role in the modern payment systems through SET protocol (Secure Electronic Transaction).
  • 27. ALGORITHM • Let p and q be two large prime numbers • Let N = pq be the modulus • Find ф(n)=(p-1).(q-1) • Choose e such that it is relatively prime to ф(n). • Choose d such that : e x d mod ф(n)=1 • Public key is (N,e) • Private key is d • To encrypt message M compute – C = Me mod N • To decrypt C compute – M = Cd mod N
  • 28. RSA ATTACKS • Factoring the Public Key To make RSA secure recommended size of p and q is 512 bits(154 decimal digits). This makes n 1024 bits. • Guessing d • Cycle Attack • Common Modulus
  • 29. Diffie Hellman • Invented by Williamson (GCHQ) and, independently, by D and H (Stanford) • A “key exchange” algorithm – Used to establish a shared symmetric key - Not for encrypting or signing but for exchanging keys.
  • 30. 1. P is very large prime no and g is its primitive root. 2. Alice chooses a large random no. x such that 0<= x <= p-1 and calculates R1= gx mod p. 3. Bob chooses another large random no. y such that 0<= y <= p-1 and calculates R2=gy mod p. 4. Alice sends R1 to Bob. Alice does not send x; she only sends R1. 5. Bob sends R2 to Alice. Bob does not send y; he only sends R2. 6. Alice calculates K= (R2)x mod p. 7. Bob calculates K= (R1)y mod p.
  • 31. ATTACKS 1. Discrete logarithm attack Intruder can intercept R1 and R2. If he can find x from R1=gx mod p and y from R2=gy mod p then he can calculate k=gxy mod p 2. Man in the middle attack.
  • 32. SOME CRYPTOGRAPHIC HASHES a) MD5(Message Digest 5) • Developed by Ron Rivest of MIT. • Was the mostly used secure hash algorithm till it was cracked. • Takes an input msg of arbitrary length and produces as output a 128-bit message digest. • The input is processed in 512-bit block. • Attacks possible on MD5 are Bruteforce and Fast collision attacks.
  • 33. SOME CRYPTOGRAPHIC HASHES b) SHA-1(Secure hash algorithm) • Developed by NIST(National Institute of standards and technology). SHA-1 Logic : • The algorithm takes as input a message with a maximum length of less than 264 bits and produces a 160-bit message digest. • The input is processed in 512-bit blocks.
  • 34. TOOLS FOR CRYPTANALYSTS • Ganzúa-A cryptanalysis tool for classical ciphers • EverCrack - Open Source Cryptanalysis Engine • Lepton's Crack • Online crackers
  • 35. SOME RESOURCES • CRYPTOGRAPHY CLASS BY STANFORD http://www.crypto-class.org/ • Awesome videos http://www.intypedia.com/ • CRYPTOGRAPHY AND NETWORK SECURITY -BEHEROUZ A FOROUZAN
  • 36. THANK YOU