SlideShare a Scribd company logo
1 of 25
Public-Key Cryptography &
 Message Authentication
Authentication

  •    Requirements - must be able to verify that:
          Message came from apparent source or author               Authentic
          Contents have not been altered                            message
          Sometimes, it was sent at a certain time or sequence


  •    Protection against active attack (falsification of data and
       transactions)




                                                                                 2



                                  ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Approaches to Message Authentication

  •    Authentication Using Conventional Encryption
          Only the sender and receiver should share a key

  •    Message Authentication without Message Encryption
          An authentication tag is generated and appended to each message


  •    Message Authentication Code - MAC
          The use of secret key to generate a small block of data, MAC
         Or
          Calculate the MAC as a function of the message and the key.
          MAC = F(K, M)




                                                                             3



                                  ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Message Authentication Code

•   Need not to be reversible
•   A & B Share a common secret key KAB


•   A send message to B
     A calculates message authentication code as a function of the message
      and the key.
     MACM1 = F(KAB, M)
     The message + MAC are transmitted to B.
     B performs the same calculation on the recieved message, using same
      KAB
     MACM2 = F(KAB, M)


     If MACM1 = F(KAB, M) = MACM2 = F(KAB, M)
        – Message has not been altered
        – From intended sender                                                4

        – Addition of sequence number, give more surity
Message Authentication with MAC




                                                           5



                               ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
One-way HASH function

•   Alternative to MAC

•   Input: A variable size message
•   Output: Fixed size message digest H(M)

•   No secret Key

•   Message digest is sent with message in such a way that message
    digest is authentic
     Using conventional encryption
     Using Public-Key encryption
     Using Secret Value



                                                                     6
One-way HASH function




                                                          7



                              ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
One-way HASH function cont.

  •    Secret value (known to sender and receiver both) is added before
       calculating the hash and removed before transmission.




  •    Variation of this technique is HMAC
                                                                          8



                                 ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Secure HASH Functions

  •    Purpose of the one-way or secure HASH function is to produce a
       ”fingerprint” of a file, message or block of data

  •    Properties of a HASH function H :
         § H can be applied to a block of data at any size
         § H produces a fixed length output
         § H(x) is easy to compute for any given x.
         § For any given value h, it is computationally in-feasible to find x such
           that H(x) = h  one-way property / pre-image resistant
         § For any given block x, it is computationally infeasible to find
           y ≠ x with H(y) = H(x)  weak collision resistance
         § It is computationally infeasible to find any pair (x, y) such that
           H(x) = H(y)      strong collision resistance
                                                                                     9



                                    ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Block cipher VS Hash function

  •    Block cipher – symmetric encryption method:
          input: blocks of plain-text of a fixed length
          output: blocks of cipher-text of the same length



  •    Hash function – both symmetric and asymmetric encryption method
          input: binary string of arbitrary length
          output: string of some fixed length




                                                                         10



                                    ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Other Secure HASH functions


                                  SHA-1                  MD5     RIPEMD-160


             Digest length    160 bits           128 bits       160 bits
              Basic unit of   512 bits           512 bits       512 bits
              processing


          Number of steps     80 (4 rounds of 64 (4 rounds of   160 (5 paired
                              20)             16)               rounds of 16)

        Maximum message 264-1 bits
              size



                                                                                11



                                   ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
HMAC
  •    A keyed-hash message authentication code, or HMAC, is a type of
       message authentication code (MAC) calculated using a cryptographic
       hash function in combination with a secret key.


  •    The cryptographic strength of the HMAC depends upon the cryptographic
       strength of the underlying hash function and on the size and quality of the
       key.


  •    An iterative hash function breaks up a message into blocks of a fixed size
       and iterates over them with a compression function.


  •    Motivations:
            Cryptographic hash functions executes faster in software than encryption
             algorithms such as DES
            Library code for cryptographic hash functions is widely available
            No export restrictions from the US
                                                                                        12



                                       ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
HMAC

                  HMACK(m) = h((K ⊕ opad) ‖ h((K ⊕ ipad) ‖ m ))
      •    h is an iterated hash function,

      •    K is a secret key padded with extra zeros to the block size of the
           hash function

      •    m is the message to be authenticated.

      •    ‖ denotes concatenation

      •    ⊕ denotes Exclusive Or (XOR)
      •    The two constants ipad and opad, each one block long, are defined
           as ipad = 0x363636...3636 and opad = 0x5c5c5c...5c5c. That is, if
           block size of the hash function is 512, ipad and opad are 64
           repetitions of the (hexadecimal) bytes 0x36 and 0x5c respectively
                                                                                13



                                    ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
HMAC Structure




Initialization Vector (IV):
a fixed-size input to a
cryptographic function. IV
is typically random or
pseudorandom




                                                                              14

                              HMACK(m) = h((K ⊕ opad) ‖ h((K ⊕ ipad) ‖ m ))
                                        ET2437 - Network Security
Public Key / Asymmetric Encryption

   •    Based on mathematical functions.
   •    The use of two separate keys has consequences in:
           key distribution
           confidentiality
           authentication



   •    The scheme has six ingredients
           Plain-text                     Encryption algorithm
           Public Key                     Private Key
           Cipher text                    Decryption algorithm



                                                                  15



                               ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Encryption with Public Key




                                                            16



                                ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Encryption with Private Key (Authentication)




                                                        17



                         ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Applications for Asymmetric Encryption

   •    Encryption/Decryption: The sender encrypts a message with the
        recipient’s public key.


   •    Digital signature: The sender ”signs” a message with its private
        key.


   •    Key exchange: Both sides (i.e. Sender & Reciever) co-operate to
        exchange a session key




                                                                           18



                                  ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Requirements for Asymmetric Encryption

 1. Computationally easy for a party B to generate a pair (PUblic key
    PUb, PRivate key PRb)
 2. Easy for sender to generate cipher-text: C = E(Pub, M)
 3. Easy for the receiver to decrypt cipher-text using private key:
               M = D(PRb, C) = D[PRb, E(PUb, M)]

 5. Computationally in-feasible to determine Private Key (PRb) knowing
      Public Key (PUb)

 6. Computationally infeasible to recover message M, knowing PUb and
      cipher-text C
 7. Either of the two related keys can be used for encryption, with the
    other used for decryption:
                                                                          19
                         M = D[PUb, E(PRb,M) = D[PRb, E(PUb,M)]
                                  ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Asymmetric Cryptographic Algorithms

   •    RSA - Ron Rivest, Adi Shamir and Len Adleman at MIT, in 1977.
           Published in 1978
           RSA is a block cipher in which plaintext and ciphertext are integers
            between 0 and n-1 for some n.
           The most widely implemented


   •    Diffie-Hellman

           Enable two users to exchange a secret key securely that can be used
            for subsequent encryption message
           Algorithm itself is limited to exchange of keys
           Compute discrete logarithms



                                                                                   20



                                    ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
The RSA Algorithm

     Encryption
       •    Plain-text:   M<n

       •    Cipher-text: C = Me (mod n)


                            Decryption
                           • Cipher-text: C

                           • Plain-text:        M = Cd (mod n) = Med mod n


     • Both sender and reciever must know the values of n and e
     • Only reciever knows the value of d
     • Public Key PU = {e,n} and Private Key PR= {d,n}
                                                                             21



                                 ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
The RSA Algorithm - Key Generation


Select p,q         p and q both prime   p=17, q=11
Calculate          n=pxq                17 x 11 = 187
Calculate                               16 x 10 = 160
Select integer e                        e=7
Calculate d                             d = 23
Public Key         PU = {e,n}           7,187
Private key        PR = {d,n}           23,187




                                                        22
Example of the RSA Algorithm




                                                             23



                                 ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
Other Algorithms

   •    Digital Signature Standard (DSS)
           Makes use of the SHA-1
           Not for encryption or key exchange


   •    Elliptic-Curve Cryptography (ECC)
             Good for smaller bit size
             Low confidence level, compared with RSA
             Very complex
             Decryption algorithm




                                                               24



                                   ET2437 - Network Security
RAJA M KHURRAM SHAHZAD
25



                         ET2437 - Network Security
RAJA M KHURRAM SHAHZAD

More Related Content

What's hot

Information and data security cryptography and network security
Information and data security cryptography and network securityInformation and data security cryptography and network security
Information and data security cryptography and network securityMazin Alwaaly
 
Is unit 5_message authentication and hash functions
Is unit 5_message authentication and hash functionsIs unit 5_message authentication and hash functions
Is unit 5_message authentication and hash functionsSarthak Patel
 
MACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block CiphersMACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block CiphersMaitree Patel
 
Message authentication and hash function
Message authentication and hash functionMessage authentication and hash function
Message authentication and hash functionomarShiekh1
 
Distribution of public keys and hmac
Distribution of public keys and hmacDistribution of public keys and hmac
Distribution of public keys and hmacanuragjagetiya
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication CodesDarshanPatil82
 
Public key cryptography and message authentication
Public key cryptography and message authenticationPublic key cryptography and message authentication
Public key cryptography and message authenticationCAS
 
Message AUthentication Code
Message AUthentication CodeMessage AUthentication Code
Message AUthentication CodeKeval Bhogayata
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authenticationchauhankapil
 
Public Key Encryption & Hash functions
Public Key Encryption & Hash functionsPublic Key Encryption & Hash functions
Public Key Encryption & Hash functionsDr.Florence Dayana
 
Cryptographic Hashing Functions
Cryptographic Hashing FunctionsCryptographic Hashing Functions
Cryptographic Hashing FunctionsYusuf Uzun
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 

What's hot (20)

Ch11
Ch11Ch11
Ch11
 
Information and data security cryptography and network security
Information and data security cryptography and network securityInformation and data security cryptography and network security
Information and data security cryptography and network security
 
Is unit 5_message authentication and hash functions
Is unit 5_message authentication and hash functionsIs unit 5_message authentication and hash functions
Is unit 5_message authentication and hash functions
 
MACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block CiphersMACs based on Hash Functions, MACs based on Block Ciphers
MACs based on Hash Functions, MACs based on Block Ciphers
 
Message Authentication: MAC, Hashes
Message Authentication: MAC, HashesMessage Authentication: MAC, Hashes
Message Authentication: MAC, Hashes
 
Message authentication and hash function
Message authentication and hash functionMessage authentication and hash function
Message authentication and hash function
 
Distribution of public keys and hmac
Distribution of public keys and hmacDistribution of public keys and hmac
Distribution of public keys and hmac
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
 
Public key cryptography and message authentication
Public key cryptography and message authenticationPublic key cryptography and message authentication
Public key cryptography and message authentication
 
Network Security Lec5
Network Security  Lec5Network Security  Lec5
Network Security Lec5
 
Message AUthentication Code
Message AUthentication CodeMessage AUthentication Code
Message AUthentication Code
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authentication
 
Public Key Encryption & Hash functions
Public Key Encryption & Hash functionsPublic Key Encryption & Hash functions
Public Key Encryption & Hash functions
 
Lecture 2 Message Authentication
Lecture 2   Message AuthenticationLecture 2   Message Authentication
Lecture 2 Message Authentication
 
Hash
HashHash
Hash
 
Cryptographic Hashing Functions
Cryptographic Hashing FunctionsCryptographic Hashing Functions
Cryptographic Hashing Functions
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
Pgp smime
Pgp smimePgp smime
Pgp smime
 
6.hash mac
6.hash mac6.hash mac
6.hash mac
 
Hash Function
Hash FunctionHash Function
Hash Function
 

Viewers also liked

Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithmsJames Wong
 
Controller encryption using RSA public-key encryption scheme (Asian Control C...
Controller encryption using RSA public-key encryption scheme (Asian Control C...Controller encryption using RSA public-key encryption scheme (Asian Control C...
Controller encryption using RSA public-key encryption scheme (Asian Control C...Kiminao Kogiso
 
Chapter 09
Chapter 09Chapter 09
Chapter 09cclay3
 
Pluggable Authentication Module
Pluggable Authentication ModulePluggable Authentication Module
Pluggable Authentication ModuleSinarShebl
 
Cryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareCryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareProf. Swapnil V. Kaware
 
Cryptography - RSA and ECDSA
Cryptography - RSA and ECDSACryptography - RSA and ECDSA
Cryptography - RSA and ECDSAAPNIC
 
Authentication Modules For Linux - PAM Architecture
Authentication Modules For Linux - PAM ArchitectureAuthentication Modules For Linux - PAM Architecture
Authentication Modules For Linux - PAM ArchitecturePriyank Kapadia
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryptionphanleson
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYKathirvel Ayyaswamy
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmIndra97065
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONraf_slide
 

Viewers also liked (14)

Sha1
Sha1Sha1
Sha1
 
Hash mac algorithms
Hash mac algorithmsHash mac algorithms
Hash mac algorithms
 
Controller encryption using RSA public-key encryption scheme (Asian Control C...
Controller encryption using RSA public-key encryption scheme (Asian Control C...Controller encryption using RSA public-key encryption scheme (Asian Control C...
Controller encryption using RSA public-key encryption scheme (Asian Control C...
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
Pluggable Authentication Module
Pluggable Authentication ModulePluggable Authentication Module
Pluggable Authentication Module
 
Cryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil KawareCryptography & Network Security By, Er. Swapnil Kaware
Cryptography & Network Security By, Er. Swapnil Kaware
 
Cryptography - RSA and ECDSA
Cryptography - RSA and ECDSACryptography - RSA and ECDSA
Cryptography - RSA and ECDSA
 
Authentication Modules For Linux - PAM Architecture
Authentication Modules For Linux - PAM ArchitectureAuthentication Modules For Linux - PAM Architecture
Authentication Modules For Linux - PAM Architecture
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryption
 
CRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITYCRYPTOGRAPHY AND NETWORK SECURITY
CRYPTOGRAPHY AND NETWORK SECURITY
 
Hashing
HashingHashing
Hashing
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 
PUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTIONPUBLIC KEY ENCRYPTION
PUBLIC KEY ENCRYPTION
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 

Similar to Lecture 3b public key_encryption

Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit ivArthyR3
 
Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit ivArthyR3
 
Lecture3a symmetric encryption
Lecture3a symmetric encryptionLecture3a symmetric encryption
Lecture3a symmetric encryptionrajakhurram
 
Information and data security cryptographic hash functions
Information and data security cryptographic hash functionsInformation and data security cryptographic hash functions
Information and data security cryptographic hash functionsMazin Alwaaly
 
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORKUNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORKjeevasreemurali
 
cryptography security
  cryptography security  cryptography security
cryptography securityZia3130
 
BAIT1103 Chapter 2
BAIT1103 Chapter 2BAIT1103 Chapter 2
BAIT1103 Chapter 2limsh
 
TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006Nate Lawson
 
CISSP Week 20
CISSP Week 20CISSP Week 20
CISSP Week 20jemtallon
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptxSurendraBasnet6
 
Encryption in php
Encryption in phpEncryption in php
Encryption in phpsana mateen
 
Seminar on Encryption and Authenticity
Seminar on Encryption and AuthenticitySeminar on Encryption and Authenticity
Seminar on Encryption and AuthenticityHardik Manocha
 
Cryptography
CryptographyCryptography
CryptographyRohan04
 
Authenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmAuthenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmVittorio Giovara
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network securityNagendra Um
 
Information and network security 42 security of message authentication code
Information and network security 42 security of message authentication codeInformation and network security 42 security of message authentication code
Information and network security 42 security of message authentication codeVaibhav Khanna
 
A Robust Cryptographic System using Neighborhood-Generated Keys
A Robust Cryptographic System using Neighborhood-Generated KeysA Robust Cryptographic System using Neighborhood-Generated Keys
A Robust Cryptographic System using Neighborhood-Generated KeysIJORCS
 
A Robust Cryptographic System using Neighborhood-Generated Keys
A Robust Cryptographic System using Neighborhood-Generated KeysA Robust Cryptographic System using Neighborhood-Generated Keys
A Robust Cryptographic System using Neighborhood-Generated KeysIJORCS
 

Similar to Lecture 3b public key_encryption (20)

Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
 
Cs8792 cns - unit iv
Cs8792   cns - unit ivCs8792   cns - unit iv
Cs8792 cns - unit iv
 
Lecture3a symmetric encryption
Lecture3a symmetric encryptionLecture3a symmetric encryption
Lecture3a symmetric encryption
 
Information and data security cryptographic hash functions
Information and data security cryptographic hash functionsInformation and data security cryptographic hash functions
Information and data security cryptographic hash functions
 
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORKUNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
UNIT3_class (1).ppt CRYPTOGRAPHY NOTES AND NETWORK
 
Cns
CnsCns
Cns
 
cryptography security
  cryptography security  cryptography security
cryptography security
 
BAIT1103 Chapter 2
BAIT1103 Chapter 2BAIT1103 Chapter 2
BAIT1103 Chapter 2
 
Mj2521372142
Mj2521372142Mj2521372142
Mj2521372142
 
TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006TLS/SSL Protocol Design 201006
TLS/SSL Protocol Design 201006
 
CISSP Week 20
CISSP Week 20CISSP Week 20
CISSP Week 20
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptx
 
Encryption in php
Encryption in phpEncryption in php
Encryption in php
 
Seminar on Encryption and Authenticity
Seminar on Encryption and AuthenticitySeminar on Encryption and Authenticity
Seminar on Encryption and Authenticity
 
Cryptography
CryptographyCryptography
Cryptography
 
Authenticated Encryption Gcm Ccm
Authenticated Encryption Gcm CcmAuthenticated Encryption Gcm Ccm
Authenticated Encryption Gcm Ccm
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 
Information and network security 42 security of message authentication code
Information and network security 42 security of message authentication codeInformation and network security 42 security of message authentication code
Information and network security 42 security of message authentication code
 
A Robust Cryptographic System using Neighborhood-Generated Keys
A Robust Cryptographic System using Neighborhood-Generated KeysA Robust Cryptographic System using Neighborhood-Generated Keys
A Robust Cryptographic System using Neighborhood-Generated Keys
 
A Robust Cryptographic System using Neighborhood-Generated Keys
A Robust Cryptographic System using Neighborhood-Generated KeysA Robust Cryptographic System using Neighborhood-Generated Keys
A Robust Cryptographic System using Neighborhood-Generated Keys
 

More from rajakhurram

Malicious software
Malicious softwareMalicious software
Malicious softwarerajakhurram
 
Lecture malicious software
Lecture malicious softwareLecture malicious software
Lecture malicious softwarerajakhurram
 
Lecture 12 malicious software
Lecture 12 malicious software Lecture 12 malicious software
Lecture 12 malicious software rajakhurram
 
Lecture 11 wifi security
Lecture 11 wifi securityLecture 11 wifi security
Lecture 11 wifi securityrajakhurram
 
Lecture 10 intruders
Lecture 10 intrudersLecture 10 intruders
Lecture 10 intrudersrajakhurram
 
Lecture 9 key distribution and user authentication
Lecture 9 key distribution and user authentication Lecture 9 key distribution and user authentication
Lecture 9 key distribution and user authentication rajakhurram
 
Lecture 7 certificates
Lecture 7 certificatesLecture 7 certificates
Lecture 7 certificatesrajakhurram
 
Lecture 6 web security
Lecture 6 web securityLecture 6 web security
Lecture 6 web securityrajakhurram
 
Lecture 5 ip security
Lecture 5 ip securityLecture 5 ip security
Lecture 5 ip securityrajakhurram
 
Lecture 4 firewalls
Lecture 4 firewallsLecture 4 firewalls
Lecture 4 firewallsrajakhurram
 
Lecture2 network attack
Lecture2 network attackLecture2 network attack
Lecture2 network attackrajakhurram
 
Lecture1 Introduction
Lecture1 Introduction Lecture1 Introduction
Lecture1 Introduction rajakhurram
 
Lecture 8 mail security
Lecture 8 mail securityLecture 8 mail security
Lecture 8 mail securityrajakhurram
 

More from rajakhurram (13)

Malicious software
Malicious softwareMalicious software
Malicious software
 
Lecture malicious software
Lecture malicious softwareLecture malicious software
Lecture malicious software
 
Lecture 12 malicious software
Lecture 12 malicious software Lecture 12 malicious software
Lecture 12 malicious software
 
Lecture 11 wifi security
Lecture 11 wifi securityLecture 11 wifi security
Lecture 11 wifi security
 
Lecture 10 intruders
Lecture 10 intrudersLecture 10 intruders
Lecture 10 intruders
 
Lecture 9 key distribution and user authentication
Lecture 9 key distribution and user authentication Lecture 9 key distribution and user authentication
Lecture 9 key distribution and user authentication
 
Lecture 7 certificates
Lecture 7 certificatesLecture 7 certificates
Lecture 7 certificates
 
Lecture 6 web security
Lecture 6 web securityLecture 6 web security
Lecture 6 web security
 
Lecture 5 ip security
Lecture 5 ip securityLecture 5 ip security
Lecture 5 ip security
 
Lecture 4 firewalls
Lecture 4 firewallsLecture 4 firewalls
Lecture 4 firewalls
 
Lecture2 network attack
Lecture2 network attackLecture2 network attack
Lecture2 network attack
 
Lecture1 Introduction
Lecture1 Introduction Lecture1 Introduction
Lecture1 Introduction
 
Lecture 8 mail security
Lecture 8 mail securityLecture 8 mail security
Lecture 8 mail security
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Recently uploaded (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Lecture 3b public key_encryption

  • 1. Public-Key Cryptography & Message Authentication
  • 2. Authentication • Requirements - must be able to verify that:  Message came from apparent source or author Authentic  Contents have not been altered message  Sometimes, it was sent at a certain time or sequence • Protection against active attack (falsification of data and transactions) 2 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 3. Approaches to Message Authentication • Authentication Using Conventional Encryption  Only the sender and receiver should share a key • Message Authentication without Message Encryption  An authentication tag is generated and appended to each message • Message Authentication Code - MAC  The use of secret key to generate a small block of data, MAC Or  Calculate the MAC as a function of the message and the key.  MAC = F(K, M) 3 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 4. Message Authentication Code • Need not to be reversible • A & B Share a common secret key KAB • A send message to B  A calculates message authentication code as a function of the message and the key.  MACM1 = F(KAB, M)  The message + MAC are transmitted to B.  B performs the same calculation on the recieved message, using same KAB  MACM2 = F(KAB, M)  If MACM1 = F(KAB, M) = MACM2 = F(KAB, M) – Message has not been altered – From intended sender 4 – Addition of sequence number, give more surity
  • 5. Message Authentication with MAC 5 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 6. One-way HASH function • Alternative to MAC • Input: A variable size message • Output: Fixed size message digest H(M) • No secret Key • Message digest is sent with message in such a way that message digest is authentic  Using conventional encryption  Using Public-Key encryption  Using Secret Value 6
  • 7. One-way HASH function 7 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 8. One-way HASH function cont. • Secret value (known to sender and receiver both) is added before calculating the hash and removed before transmission. • Variation of this technique is HMAC 8 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 9. Secure HASH Functions • Purpose of the one-way or secure HASH function is to produce a ”fingerprint” of a file, message or block of data • Properties of a HASH function H : § H can be applied to a block of data at any size § H produces a fixed length output § H(x) is easy to compute for any given x. § For any given value h, it is computationally in-feasible to find x such that H(x) = h  one-way property / pre-image resistant § For any given block x, it is computationally infeasible to find y ≠ x with H(y) = H(x)  weak collision resistance § It is computationally infeasible to find any pair (x, y) such that H(x) = H(y)  strong collision resistance 9 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 10. Block cipher VS Hash function • Block cipher – symmetric encryption method:  input: blocks of plain-text of a fixed length  output: blocks of cipher-text of the same length • Hash function – both symmetric and asymmetric encryption method  input: binary string of arbitrary length  output: string of some fixed length 10 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 11. Other Secure HASH functions SHA-1 MD5 RIPEMD-160 Digest length 160 bits 128 bits 160 bits Basic unit of 512 bits 512 bits 512 bits processing Number of steps 80 (4 rounds of 64 (4 rounds of 160 (5 paired 20) 16) rounds of 16) Maximum message 264-1 bits size 11 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 12. HMAC • A keyed-hash message authentication code, or HMAC, is a type of message authentication code (MAC) calculated using a cryptographic hash function in combination with a secret key. • The cryptographic strength of the HMAC depends upon the cryptographic strength of the underlying hash function and on the size and quality of the key. • An iterative hash function breaks up a message into blocks of a fixed size and iterates over them with a compression function. • Motivations:  Cryptographic hash functions executes faster in software than encryption algorithms such as DES  Library code for cryptographic hash functions is widely available  No export restrictions from the US 12 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 13. HMAC HMACK(m) = h((K ⊕ opad) ‖ h((K ⊕ ipad) ‖ m )) • h is an iterated hash function, • K is a secret key padded with extra zeros to the block size of the hash function • m is the message to be authenticated. • ‖ denotes concatenation • ⊕ denotes Exclusive Or (XOR) • The two constants ipad and opad, each one block long, are defined as ipad = 0x363636...3636 and opad = 0x5c5c5c...5c5c. That is, if block size of the hash function is 512, ipad and opad are 64 repetitions of the (hexadecimal) bytes 0x36 and 0x5c respectively 13 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 14. HMAC Structure Initialization Vector (IV): a fixed-size input to a cryptographic function. IV is typically random or pseudorandom 14 HMACK(m) = h((K ⊕ opad) ‖ h((K ⊕ ipad) ‖ m )) ET2437 - Network Security
  • 15. Public Key / Asymmetric Encryption • Based on mathematical functions. • The use of two separate keys has consequences in:  key distribution  confidentiality  authentication • The scheme has six ingredients  Plain-text Encryption algorithm  Public Key Private Key  Cipher text Decryption algorithm 15 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 16. Encryption with Public Key 16 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 17. Encryption with Private Key (Authentication) 17 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 18. Applications for Asymmetric Encryption • Encryption/Decryption: The sender encrypts a message with the recipient’s public key. • Digital signature: The sender ”signs” a message with its private key. • Key exchange: Both sides (i.e. Sender & Reciever) co-operate to exchange a session key 18 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 19. Requirements for Asymmetric Encryption 1. Computationally easy for a party B to generate a pair (PUblic key PUb, PRivate key PRb) 2. Easy for sender to generate cipher-text: C = E(Pub, M) 3. Easy for the receiver to decrypt cipher-text using private key: M = D(PRb, C) = D[PRb, E(PUb, M)] 5. Computationally in-feasible to determine Private Key (PRb) knowing Public Key (PUb) 6. Computationally infeasible to recover message M, knowing PUb and cipher-text C 7. Either of the two related keys can be used for encryption, with the other used for decryption: 19 M = D[PUb, E(PRb,M) = D[PRb, E(PUb,M)] ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 20. Asymmetric Cryptographic Algorithms • RSA - Ron Rivest, Adi Shamir and Len Adleman at MIT, in 1977.  Published in 1978  RSA is a block cipher in which plaintext and ciphertext are integers between 0 and n-1 for some n.  The most widely implemented • Diffie-Hellman  Enable two users to exchange a secret key securely that can be used for subsequent encryption message  Algorithm itself is limited to exchange of keys  Compute discrete logarithms 20 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 21. The RSA Algorithm Encryption • Plain-text: M<n • Cipher-text: C = Me (mod n) Decryption • Cipher-text: C • Plain-text: M = Cd (mod n) = Med mod n • Both sender and reciever must know the values of n and e • Only reciever knows the value of d • Public Key PU = {e,n} and Private Key PR= {d,n} 21 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 22. The RSA Algorithm - Key Generation Select p,q p and q both prime p=17, q=11 Calculate n=pxq 17 x 11 = 187 Calculate 16 x 10 = 160 Select integer e e=7 Calculate d d = 23 Public Key PU = {e,n} 7,187 Private key PR = {d,n} 23,187 22
  • 23. Example of the RSA Algorithm 23 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 24. Other Algorithms • Digital Signature Standard (DSS)  Makes use of the SHA-1  Not for encryption or key exchange • Elliptic-Curve Cryptography (ECC)  Good for smaller bit size  Low confidence level, compared with RSA  Very complex  Decryption algorithm 24 ET2437 - Network Security RAJA M KHURRAM SHAHZAD
  • 25. 25 ET2437 - Network Security RAJA M KHURRAM SHAHZAD