0% found this document useful (0 votes)
18 views5 pages

Hash Algorithm

The document discusses various hashing algorithms, focusing on properties such as hash size, block size, rounds, and collision resistance, highlighting the security levels of each. It emphasizes that MD5, MD4, and SHA-1 are weak and should be avoided, while SHA-256, SHA-384, and SHA-512 provide strong security. Additionally, it includes a comparison table of different algorithms, their characteristics, and recommended usage.

Uploaded by

rishu gill
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views5 pages

Hash Algorithm

The document discusses various hashing algorithms, focusing on properties such as hash size, block size, rounds, and collision resistance, highlighting the security levels of each. It emphasizes that MD5, MD4, and SHA-1 are weak and should be avoided, while SHA-256, SHA-384, and SHA-512 provide strong security. Additionally, it includes a comparison table of different algorithms, their characteristics, and recommended usage.

Uploaded by

rishu gill
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Hash Size (Output Size)

 This is the length of the final hash produced by the algorithm.

 A bigger hash size means better security because it’s harder to guess or break.

📌 Example:

 MD5 → 128-bit hash

o 🔹 "hello" → 5d41402abc4b2a76b9719d911017c592

 SHA-256 → 256-bit hash (More secure, longer output)

o 🔹 "hello" →
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

2. Block Size

 Hashing works in chunks (blocks), not all at once.

 A bigger block size makes the hashing process more efficient for large files.

📌 Example:

 MD5 → 512-bit block size

 SHA-512 → 1024-bit block size (Processes larger chunks at a time)

Imagine writing a book:

 MD5 reads 512 words at a time, while

 SHA-512 reads 1024 words at a time—so it's faster for big data.

3. Rounds

 The number of times the algorithm scrambles the input before finalizing the hash.

 More rounds = stronger security but slower processing.

📌 Example:

 MD5 → 64 rounds (weak, easy to break)

 SHA-256 → 64 rounds (strong, secure)

 SHA-512 → 80 rounds (even stronger)

💡 Think of rounds like mixing cake batter:

 MD5 (64 rounds) → Mixes the batter 64 times.

 SHA-512 (80 rounds) → Mixes it 80 times for a smoother, more secure result.

4. Collision Resistance
 A collision happens when two different inputs give the same hash output—this is bad for
security.

 Good hashing algorithms make collisions nearly impossible.

📌 Example:

 MD5 (Weak) ❌: Hackers found two different messages that produce the same hash (md5("A") ==
md5("B")).

 SHA-256 (Strong) ✅: No one has found a collision yet, making it safe for security.

💡 Think of it like fingerprints:

 MD5 is weak because two people might have the same fingerprint (bad!).

 SHA-256 ensures everyone has a unique fingerprint (good!).

Quick Summary

Property Meaning Example

Hash Size Final hash length (more bits = stronger) MD5 → 128 bits, SHA-256 → 256 bits

Block Size How much data is processed at a time MD5 → 512 bits, SHA-512 → 1024 bits

Rounds How many times the data is scrambled MD5 → 64 rounds, SHA-512 → 80
rounds

Collision Hardness of finding two inputs with the MD5 is weak (collisions found), SHA-
Resistance same hash 256 is strong

🔹 Use SHA-256 or SHA-512 for security (passwords, encryption).


🔹 Avoid MD5 and SHA-1 (they are weak and easy to break).
🔹 CRC32 & Adler32 are only for error checking, not security.

Comprehensive Hashing Algorithm Comparison Table

Algorith Full Form Hash Bloc Round Speed Collision Securit Usage &
m Size k s Resistan y Level Description
(bits) Size ce
(bits
)

MD5 Message 128 512 64 Fast Weak Low Used for


Digest (broken) checksums
Algorithm 5 and non-
secure
applications.
Fast but
vulnerable to
collisions.

MD4 Message 128 512 48 Very Weak Low Faster than


Digest Fast (broken) MD5 but
Algorithm 4 more
insecure.
Now
obsolete.

SHA-1 Secure Hash 160 512 80 Moderat Weak Low Used in


Algorithm 1 e (broken) digital
signatures
but is now
deprecated
due to
vulnerabilitie
s.

SHA- Secure Hash 256 512 64 Moderat Strong High Used in


256 Algorithm e blockchain,
256 SSL/TLS,
and digital
signatures.
Secure and
widely
adopted.

SHA- Secure Hash 384 1024 80 Slower Strong Very A variant of


384 Algorithm High SHA-512,
384 optimized for
high-security
applications.

SHA- Secure Hash 512 1024 80 Slower Strong Very Used in


512 Algorithm High cryptography
512 for secure
password
storage and
digital
signatures.

RIPEMD RACE 160 512 80 Moderat Strong High An


-160 Integrity alternative to
Primitives e SHA-1, used
Evaluation in
Message cryptographi
Digest 160 c
applications
but less
common.

PANAM - (No 256 512 32 Very Moderate Mediu High-speed


A standard full Fast m cryptographi
form) c hash
function,
also used in
stream
ciphers.

Tiger - (No 192 512 24 Fast Strong High Designed for


standard full 64-bit
form) systems,
used in
cryptography
and integrity
checks.

MD2 Message 128 128 18 Slow Weak Low Used in


Digest legacy
Algorithm 2 applications
and digital
signatures
but is now
insecure.

ADLER3 Named after 32 N/A 1 Very Very Very A simple


2 Mark Adler Fast Weak Low checksum
algorithm,
used for
error
detection but
not security.

CRC32 Cyclic 32 N/A 1 Very Very Very Used in


Redundancy Fast Weak Low error-
Check 32 checking
applications
like ZIP files
and network
packets.

HMAC Hashed Varies Varie Varies Slower Very High Uses a


Message (depen s Strong (if secret key
Authenticati ds on key is for message
on Code hash) secure) authenticatio
n, commonly
used in
secure
communicati
on protocols.

Key Points

 MD5, MD4, and SHA-1 are broken and should not be used for cryptographic security.

 SHA-256, SHA-384, and SHA-512 offer strong security and are widely adopted.

 RIPEMD-160 is a lesser-known alternative to SHA-1 but still secure.

 PANAMA and Tiger are optimized for speed and used in cryptographic applications.

 MD2, ADLER32, and CRC32 are outdated or non-secure, mainly used for integrity checks.

 HMAC enhances security by incorporating a secret key with a hash function.

You might also like