Hashing Digital Signature
Hashing Digital Signature
1. What is Hashing?
Hashing is a process where you convert data (like a file or message) into a fixed-
size string of characters, which usually looks like random letters and numbers.
This string is called a hash or hash value.
It's used to ensure data integrity, meaning it helps check if the data has been
changed or tampered with. Even a small change in the input data will result in a
completely different hash.
You take any data (like a file, message, or password) and run it through a hashing
algorithm (e.g., SHA-256, MD5).
The algorithm generates a hash value of fixed length (e.g., SHA-256 gives a 64-
character output).
This hash value is like a fingerprint of the data. If you change the data slightly, the
hash changes completely.
Example of Hashing:
Let's say we have the word "hello".
Hashing with SHA-256 could result in something like:
"hello" →
"2cf24dba5fb0a30e26e83b2ac5b9e29e1b1698b68d4f201aa17d1b19799fbc63"
If you change the word to "Hello" (note the capital 'H'), the hash will be
completely different:
"Hello" →
"8b1a9953c4611296a827abf8c47804d7d4f2e61c7f3f7f8b65e7cf9c29c4fd99"
When someone wants to send a secure message, they first hash the message
using a hashing algorithm (like SHA-256).
They then encrypt the hash using their private key. This encrypted hash is the
digital signature.
The recipient can use the sender's public key to decrypt the signature and obtain
the hash.
The recipient then hashes the received message and compares it to the
decrypted hash. If they match, it confirms that the message is intact and came
from the sender.
Integrity: Ensures that the message hasn’t been changed during transmission.
Non-repudiation: The sender cannot deny sending the message because only
they could have created the signature using their private key.
1. Sender's Side:
2cf24dba5fb0a30e26e83b2ac5b9e29e1b1698b68d4f201aa17d1b19799fbc63
1. Receiver's Side:
They hash the received message and decrypt the digital signature using the
sender's public key.
If the decrypted hash matches the hash of the received message, the receiver
knows the message is authentic and hasn’t been altered.
Summary of Differences:
Hashing: A one-way function that produces a fixed-size output from any input. It's
used to ensure data integrity.
Digital Signature: A combination of hashing and encryption, used to verify the
authenticity and integrity of a message.
Key Takeaways:
Hashing is used to create a fingerprint of data, ensuring it hasn’t been altered.
Digital signatures provide a secure way to verify both the identity of the sender
and the integrity of the message.
Visual Representation:
1. Hashing:
1. Digital Signature:
Receiver: Decrypt with Public Key → Compare with Hash of Received Message