Lecture#6- Hash Functions and Digital Signatures (3)
Lecture#6- Hash Functions and Digital Signatures (3)
01 | Sikandar Abbasi
Message Integrity and Role of Hash Functions
Message integrity:
Hash functions are widely used to verify message integrity. By hashing a message
and sending both the message and its hash, the recipient can check if the message
has been altered during transmission by comparing the computed hash value of the
received message to the original.
Used in file verification, digital signatures, and HMAC (discussed later).
Common attack:
Collision attacks: When an attacker finds two different inputs that produce the same
hash value, it undermines message integrity.
01 | Sikandar Abbasi
Cryptographic Hash Functions
8b1a9953c4611296a827abf8c47804d7
Weaknesses: Vulnerable to collision attacks, leading to phased-out usage in favor
of more secure alternatives like SHA.
01 | Sikandar Abbasi
Cryptographic Hash Functions
01 | Sikandar Abbasi
Cryptographic Hash Functions
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
01 | Sikandar Abbasi
Cryptographic Hash Functions
01 | Sikandar Abbasi
Cryptographic Hash Functions
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
01 | Sikandar Abbasi
Digital Signatures
01 | Sikandar Abbasi
Digital Signatures
Use cases:
Digital signatures are used in SSL certificates, software distribution, and
electronic contracts.
Digital certificates (issued by a certificate authority) are often used to associate a
public key with the identity of a person or organization.
Algorithms used:
RSA (Rivest-Shamir-Adleman): Commonly used for signing and verifying digital
signatures.
ECDSA (Elliptic Curve Digital Signature Algorithm): An elliptic curve-based
algorithm known for stronger security with smaller key sizes than RSA.
01 | Sikandar Abbasi
HMAC (Hash-based Message Authentication Code)
What is HMAC?
HMAC is a specific type of message authentication code (MAC) involving a
cryptographic hash function combined with a secret key. It ensures both the
integrity and authenticity of a message.
Unlike simple hash functions, HMAC also uses a secret key along with the message
to generate the hash, making it resistant to modification or tampering by unauthorized
parties.
01 | Sikandar Abbasi
HMAC (Hash-based Message Authentication Code)
01 | Sikandar Abbasi
Case Studies and Applications
01 | Sikandar Abbasi
KEY MANAGEMENT AND DISTRIBUTION
01 | Sikandar Abbasi
Key Management and Distribution
Introduction:
Key management is one of the critical aspects of cryptographic systems. Without
proper key management, even the most secure cryptographic algorithms can be
compromised. Key distribution refers to the process of securely delivering
cryptographic keys to communicating parties.
Key Points:
Keys: Secret data used in encryption to ensure that messages are protected from
unauthorized access.
Distribution Challenge: How to securely share these keys with others without them
being intercepted by attackers.
01 | Sikandar Abbasi
Public Key Infrastructure (PKI)
Overview:
• Public key infrastructure (PKI) is a system that manages the creation, distribution,
and revocation of public keys.
• It includes Certification Authorities (CAs), which issue digital certificates that
verify the identity of the key holders.
• Public key: Shared openly and used by anyone to encrypt a message.
• Private key: Kept secret and used to decrypt the message.
Applications:
• Used in securing websites (HTTPS), email encryption, and digital signatures.
01 | Sikandar Abbasi
Public Key Infrastructure (PKI)
01 | Sikandar Abbasi
Digital Certificates
Definition: A digital certificate is like an electronic passport. It allows one entity to prove
its identity to others. The certificate includes:
Public key of the entity.
Identity information: Who the certificate belongs to (name, organization, etc.).
Signature of the CA: Proves the certificate has been issued by a trusted source.
Types of Digital Certificates:
Self-signed certificates: These are signed by the same entity to which they belong.
They are often used in internal networks but not ideal for public trust.
CA-signed certificates: Trusted more widely because a CA verifies the identity
before issuing the certificate.
01 | Sikandar Abbasi
Digital Certificates
Certificate Lifecycle:
Creation: The certificate is generated and issued.
Validation: It remains valid for a specific period.
Revocation: If compromised, the certificate is revoked.
01 | Sikandar Abbasi
Certificate Authorities
Example: Let’s Encrypt is a widely known CA that provides free digital certificates.
01 | Sikandar Abbasi
Trust Models
Definition: A trust model defines how parties in a PKI system establish and manage
trust. The model dictates how certificates are verified and how the trust chain works.
Types of Trust Models:
Hierarchical Trust Model: A single root CA is at the top of the hierarchy, and it
delegates trust to subordinate CAs. This structure creates a clear, centralized trust
path.
• Advantage: Clear chain of trust.
• Disadvantage: If the root CA is compromised, the entire system is at risk.
Web of Trust: Used in systems like PGP (Pretty Good Privacy). Instead of a central
CA, trust is built between users who mutually certify each other's keys.
• Advantage: Decentralized, no need for a central authority.
• Disadvantage: Can become complex as the number of users grows.
01 | Sikandar Abbasi
Trust Models
Bridge CA: A hybrid model where multiple CAs trust each other through a "bridge"
CA. This model allows different organizations or entities to interoperate.
• Advantage: Flexible and scalable.
• Disadvantage: Complexity in managing trust relationships between CAs.
01 | Sikandar Abbasi
Trust Chain
• The trust chain works by verifying the certificate issued by one CA based on the
certificates it trusts (higher-level CA).
• A certificate signed by a trusted CA is trusted by users because they already trust the
CA’s signature.
01 | Sikandar Abbasi
THANK YOU