Hashing Digital Signature
Hashing Digital Signature
Weaknesses
David’s
Bob’s Bob’s Public Key
Message Trudeau
Cipher Encrypted David
+ Public key (Middle-man)
Message
Trudeau’s David’s
Trudeau’s Trudeau’s
New Message Message
Encrypted Cipher + public key Encrypted Cipher + public key
Message Message
How it work
• Let's say Alice wants to send Bob a confidential message:
• Alice requests Bob’s public key to encrypt the message.
• Eve intercepts this request and sends her own public key
to Alice, pretending it’s Bob’s.
• Alice encrypts the message with Eve’s public key and
sends it back.
• Eve decrypts the message, reads it, and then re-encrypts
it using Bob’s actual public key.
• Bob receives the message and decrypts it, completely
unaware that Eve has read the contents.
Session Key Encryption Process
• Definition:
S/MIME is a standard for public key encryption and signing of MIME
(Multipurpose Internet Mail Extension) data. It secures email
communication and attachments.
• Key Points:
• Encryption: Similar to PGP, S/MIME uses a combination of symmetric
and asymmetric encryption. It supports various encryption algorithms
like RSA.
• Digital Signatures: Allows for digital signatures to authenticate the
sender and ensure message integrity.
• Supported by Major Providers: Backed by companies like Microsoft, RSA
Security, and AOL, ensuring wide compatibility with many email clients.
How it Works:
• How it Works:
• A message is encrypted using a symmetric algorithm.
• The symmetric key is encrypted using the recipient’s
public key (usually RSA).
• The recipient uses their private key to decrypt the
symmetric key and then decrypts the message.
• Use Case: Secures email and attachments for
organizations needing high-security standards, and is
widely used in enterprise environments.
Secure Socket Layer (SSL) and Transport
Layer Security (TLS)
• Definition:
SSL and TLS are cryptographic protocols designed to provide secure
communication over a network, typically used for securing web
traffic.
• Key Points:
• SSL: Older protocol used to secure TCP/IP traffic, most commonly for
HTTP (HTTPS). It ensures data encryption between client and server.
• TLS: The successor to SSL, offering stronger encryption and security.
It is the modern standard for securing internet communications.
• Uses Asymmetric and Symmetric Encryption: The handshake
process uses asymmetric encryption (RSA, ECDSA) to securely
exchange symmetric keys (AES, 3DES), which then encrypt the data.
How it Works:
• The client (browser) and server exchange public
keys.
• A secure session key is negotiated using these keys.
• The session key is used to encrypt all data sent over
the connection.
• Use Case:
Primarily used for web traffic encryption (HTTPS),
but can also secure other types of internet traffic
such as email (using STARTTLS), FTP, and more.
Key Agreement in Cryptography
• Key agreement is a cryptographic method where
two or more parties establish a shared secret
key over an insecure communication channel.
• This shared key is then used for further
encryption and decryption of messages between
the parties.
• Unlike key exchange (where one party sends a
key to another), both parties in key agreement
contribute to generating the shared key.
Asymmetric Encryption
Key Agreement
• Key agreement is a method to create secret key by
exchanging only public keys.
• Example
– Bob sends Alice his public key
– Alice sends Bob her public key
– Bob uses Alice’s public key and his private key to generate
a session key
– Alice uses Bob’s public key and her private key to generate
a session key
– Using a key agreement algorithm both will generate same
key Alice’s
Private Key
– Bob and Alice do not need to transfer any key
Bob’s Cipher
Public Key
(DES) Alice and Bob
Bob’s Session Key
Generate Same
Private Key Session Key!
Alice’s Cipher
Public Key
(DES)
Asymmetric Encryption
Key Agreement con’t.
a) Message
unencrypted
d) Message
encrypted
Hash Functions & Digital
Signatures - PKCS
Example; Password Verification Using
Hashing
• User Creates a Password:
“mysecurepassword”
• System Stores Hashed Password:
Stored Hash:
c00f58a4f1de9c60acb8a2b1ac91be5de01ddf1df04
0272f9289534a0d6e799e
• User Logs In:
– Password is hashed again.
• Password Verification:
– If the new hash matches the stored hash, access is
granted.
Applications of Hashing Techniques
• Password Storage:
– Secures user credentials using salted hashes.
• Data Integrity:
– Ensures data is not altered during transmission.
• Digital Signatures:
– Verifies the authenticity and integrity of digital
documents.
Authentication
Message Digests
• A message digest is a fingerprint for a
document
• Purpose of the message digest is to provide
proof that data has not altered
• Process of generating a message digest from
data is called hashing
• Hash functions are one way functions with
following properties
– Infeasible to reverse the function
– Infeasible to construct two messages which hash to
same digest
• Commonly used hash algorithms are
– MD5 – 128 bit hashing algorithm by Ron Rivest of
RSA
– SHA & SHA-1 – 162
Message bit hashing algorithm
Message
Digest
Digest developed
by NIST Algorithm
Message Authentication Codes
Basics
Message
Message Digest Digest
Algorithm
Secret Key
Common Cryptographic Hash Functions
• SHA-256:
– Part of the SHA-2 family.
– Produces a 256-bit hash.
– Widely used in blockchain and digital signatures.
• SHA-3 (Secure Hash Algorithm 3):
– Designed to be more secure and resistant to
attacks than SHA-2.
– Can generate hash values of different lengths (224,
256, 384, 512 bits).
lide 6: Comparison of Hashing Techniques
• RSA (Rivest-Shamir-Adleman):
– Used for both encryption and digital signatures.
• DSA (Digital Signature Algorithm):
– U.S. government standard for digital signatures.
• ECDSA (Elliptic Curve Digital Signature
Algorithm):
– Offers higher security with shorter key lengths, a
variation of DSA.
Alice want to send his public key to Bob
• Problem: What if when Alice Send his Public
Key to Bob. Tom act as man-in-the-middle and
receive the Public Key.
• Stop that Public Key and then create his own
pair of Public and private keys.
• Tom Send His Public Key To Bob
• Now Bob has Tom Public Thinking that it is
Alice public Key
Now Alice want to send a message to Bob .He encrypt
the message using his private key
Tom paly his role and receive the message ,decrypt the
message using alice public key
Tome encrypt the message using his private key
Tom private key encrypted message
Tom forward the message to Bob
Bob uses Tom Public key to decrypt the message and
see the content. Thinking that the message came from
Alice.
Bob Thinking that the message came from Alice.
• Now this is a big problem
Digital Certificate
• Digital Certificate Associate User Identity with
Public Key.
• When Alice want to send his public key to
bob .he will send the digital certificate.
Digital Certificate is issued by third party
agency
Digital Certificate
• A Digital Certificate in cryptography, often
referred to as a public key certificate, is a
digital document used to prove the ownership
of a public key.
• It binds a public key with information about
the key's owner, such as their identity.
• Digital certificates are issued by Certificate
Authorities (CAs), trusted entities that verify
the certificate holder’s identity.
Alice want to get digital certificate. She generate a certificate
signing Request
Certificate authority issued a certificate
Digital Certificate
• The info on Digital Certificate include
Name
Public Key
Name of the Issuer
Digital Signature of issuer
Serial No
Expiration date
Digital certificate is Forward back to Alice
Alice will communicate through DC
Alice Sends his digital certificate to bob
When bob to verify this Certificate, he verify this
through that certificate authority.
verification
• When certificate authority received certificate
issuing request from Alice. The certificate
authority generate a hash of all the
information there using one of the hashing
algorithm.
• The certificate authority encrypted the hash
with their private key.
• Now if the encrypted hash will be decrypted
using certificate authority public key.
verification
• When bob receive this digital certificate ,he
calculate a hash of the information in there.
• Then he went to get the public key of certificate
authority and decrypt the hash, that was encrypted
in the digital certificate.
• If he decrypt that hash with certificate authority
public key,then he know that hash was signed by
certificate authority that was mentioned on digital
certificate.
• He compare both the hashes
Components of a Digital Certificate