SlideShare a Scribd company logo
1 of 6
Cryptography - Hash
Functions
5 minutes series
Abdul Manaf Vellakodath
Security Architect
Hash functions
● Suppose, you need an identifier
that uniquely identifies a
document or an installation file,
and any change (even a single
bit) to the content of the file
should completely change the
identifier… then you are looking
for a Hash function.
● HASH is a one-way function. I.e, you can
create a HASH from a message, but you
can’t recover (or decipher) the message
from the HASH value.
● No two separate message would ever
produce the same HASH value. If it does,
don’t use that HASH algorithm.
● There are many popular Hash functions.
Some of them are: RC4, MD5, SHA1,
SHA2, SHA3 etc.
● This document will describe some
properties of SHA-2, and explain how a
simple HASH function works.
HASH Value Creation
Hash
Algorithm #1
Message Hash
(Message Digest)
Hello World!
#1Hash
(Message Digest)
MD5 ed076287532e86365e841e92bfc50d8c
Hash value of the message “Hello World!” is
“ed076287532e86365e841e92bfc50d8c”. If
there is a slight change in the message, it
will produce a totally separate hash value.
HASH Value Verification
Hash
Algorithm #2
Message Hash
(Message Digest)
Note that both the message and its
corresponding hash value could be replaced
by someone in the middle. To protect such
‘man-in-the-middle’ attacks, use HMAC,
CBC-MAC, Digital Signatures etc.
Repeat the Hash Value Creation process
(as before), and then check against the
Hash Value received along with the
message. If both hash value matches (i.e.
#1 = #2), then it is the hash value
corresponds to the original message.
HASH function (SHA-256) - A very good one!
Algorithm SHA-256
Length of hash value 256 bits
Operates on 512 bits block
Maximum message size (2^64) - 1 (i.e. works on pretty big message sizes)
Hash operations A combination of AND, XOR, Rotation, ADD (Mod 2^64), OR, SHR
Rounds of operation 64
Hash Algorithms (very bad ones, of course!)
unsigned xor_hash(void *key, int len)
{
unsigned char *p = key;
unsigned h = 0;
int i;
for (i = 0; i < len; i++)
{
h ^= p[i];
}
return h;
}
unsigned add_hash(void *key, int len)
{
unsigned char *p = key;
unsigned h = 0;
int i;
for (i = 0; i < len; i++)
{
h += p[i];
}
return h;
}
XOR each of the values together to derive the hash ADD each of the values together to derive the hash
These methods are
just for illustration
purposes only.
They are susceptible
to collision, as you
can imagine, if you
jumble up the
message, and
processed (XOR or
ADD), it will yield the
same hash value.
Therefore, these
algorithms are very
poor hash functions.

More Related Content

What's hot

Cryptographic Hashing Functions
Cryptographic Hashing FunctionsCryptographic Hashing Functions
Cryptographic Hashing FunctionsYusuf Uzun
 
Message Authentication using Message Digests and the MD5 Algorithm
Message Authentication using Message Digests and the MD5 AlgorithmMessage Authentication using Message Digests and the MD5 Algorithm
Message Authentication using Message Digests and the MD5 AlgorithmAjay Karri
 
The MD5 hashing algorithm
The MD5 hashing algorithmThe MD5 hashing algorithm
The MD5 hashing algorithmBob Landstrom
 
Cryptography Ashik
Cryptography AshikCryptography Ashik
Cryptography AshikAshik Iqbal
 
Hashing Algorithm: MD5
Hashing Algorithm: MD5Hashing Algorithm: MD5
Hashing Algorithm: MD5ijsrd.com
 
01204427-Hash_Crypto (1).ppt
01204427-Hash_Crypto (1).ppt01204427-Hash_Crypto (1).ppt
01204427-Hash_Crypto (1).pptGnanalakshmiV
 
Hash Techniques in Cryptography
Hash Techniques in CryptographyHash Techniques in Cryptography
Hash Techniques in CryptographyBasudev Saha
 
Message authentication with md5
Message authentication with md5Message authentication with md5
Message authentication with md5志璿 楊
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsSam Bowne
 
Secure Hashing Techniques - Introduction
Secure Hashing Techniques - IntroductionSecure Hashing Techniques - Introduction
Secure Hashing Techniques - IntroductionUdhayyagethan Mano
 
How Hashing Algorithms Work
How Hashing Algorithms WorkHow Hashing Algorithms Work
How Hashing Algorithms WorkCheapSSLsecurity
 

What's hot (17)

Cryptographic Hashing Functions
Cryptographic Hashing FunctionsCryptographic Hashing Functions
Cryptographic Hashing Functions
 
Message Authentication using Message Digests and the MD5 Algorithm
Message Authentication using Message Digests and the MD5 AlgorithmMessage Authentication using Message Digests and the MD5 Algorithm
Message Authentication using Message Digests and the MD5 Algorithm
 
The MD5 hashing algorithm
The MD5 hashing algorithmThe MD5 hashing algorithm
The MD5 hashing algorithm
 
Cryptography Ashik
Cryptography AshikCryptography Ashik
Cryptography Ashik
 
Hashing Algorithm: MD5
Hashing Algorithm: MD5Hashing Algorithm: MD5
Hashing Algorithm: MD5
 
Hash function
Hash functionHash function
Hash function
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
01204427-Hash_Crypto (1).ppt
01204427-Hash_Crypto (1).ppt01204427-Hash_Crypto (1).ppt
01204427-Hash_Crypto (1).ppt
 
Hash
HashHash
Hash
 
MD-5 : Algorithm
MD-5 : AlgorithmMD-5 : Algorithm
MD-5 : Algorithm
 
Hash Techniques in Cryptography
Hash Techniques in CryptographyHash Techniques in Cryptography
Hash Techniques in Cryptography
 
Message authentication with md5
Message authentication with md5Message authentication with md5
Message authentication with md5
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
MD5
MD5MD5
MD5
 
CNIT 141: 6. Hash Functions
CNIT 141: 6. Hash FunctionsCNIT 141: 6. Hash Functions
CNIT 141: 6. Hash Functions
 
Secure Hashing Techniques - Introduction
Secure Hashing Techniques - IntroductionSecure Hashing Techniques - Introduction
Secure Hashing Techniques - Introduction
 
How Hashing Algorithms Work
How Hashing Algorithms WorkHow Hashing Algorithms Work
How Hashing Algorithms Work
 

Viewers also liked

Funciones Hash Criptográficas
Funciones Hash CriptográficasFunciones Hash Criptográficas
Funciones Hash CriptográficasRaul Garcia
 
Man in the middle attacks on IEC 60870-5-104
Man in the middle attacks on IEC 60870-5-104Man in the middle attacks on IEC 60870-5-104
Man in the middle attacks on IEC 60870-5-104pgmaynard
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptographyanusachu .
 
Public key Cryptography & RSA
Public key Cryptography & RSAPublic key Cryptography & RSA
Public key Cryptography & RSAAmit Debnath
 
Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsRsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsdaxesh chauhan
 
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
 
Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)Dylan Field
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash functionChirag Patel
 
Man In The Middle - Hacking Illustrated
Man In The Middle - Hacking IllustratedMan In The Middle - Hacking Illustrated
Man In The Middle - Hacking IllustratedInfoSec Institute
 
Diffie-Hellman key exchange
Diffie-Hellman key exchangeDiffie-Hellman key exchange
Diffie-Hellman key exchangehughpearse
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key CryptographyGopal Sakarkar
 
Concept of hashing
Concept of hashingConcept of hashing
Concept of hashingRafi Dar
 

Viewers also liked (20)

Hashing
HashingHashing
Hashing
 
Funciones Hash Criptográficas
Funciones Hash CriptográficasFunciones Hash Criptográficas
Funciones Hash Criptográficas
 
Man in the middle attacks on IEC 60870-5-104
Man in the middle attacks on IEC 60870-5-104Man in the middle attacks on IEC 60870-5-104
Man in the middle attacks on IEC 60870-5-104
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
Diffie hellman
Diffie  hellmanDiffie  hellman
Diffie hellman
 
Public key Cryptography & RSA
Public key Cryptography & RSAPublic key Cryptography & RSA
Public key Cryptography & RSA
 
Cryptanalysis Lecture
Cryptanalysis LectureCryptanalysis Lecture
Cryptanalysis Lecture
 
Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsRsa and diffie hellman algorithms
Rsa and diffie hellman algorithms
 
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
 
man in the middle
man in the middleman in the middle
man in the middle
 
Cryptography
CryptographyCryptography
Cryptography
 
Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)Hash Functions, the MD5 Algorithm and the Future (SHA-3)
Hash Functions, the MD5 Algorithm and the Future (SHA-3)
 
5. message authentication and hash function
5. message authentication and hash function5. message authentication and hash function
5. message authentication and hash function
 
Fundamentals of cryptography
Fundamentals of cryptographyFundamentals of cryptography
Fundamentals of cryptography
 
Man In The Middle - Hacking Illustrated
Man In The Middle - Hacking IllustratedMan In The Middle - Hacking Illustrated
Man In The Middle - Hacking Illustrated
 
Hash Function
Hash FunctionHash Function
Hash Function
 
Hashing PPT
Hashing PPTHashing PPT
Hashing PPT
 
Diffie-Hellman key exchange
Diffie-Hellman key exchangeDiffie-Hellman key exchange
Diffie-Hellman key exchange
 
Public Key Cryptography
Public Key CryptographyPublic Key Cryptography
Public Key Cryptography
 
Concept of hashing
Concept of hashingConcept of hashing
Concept of hashing
 

Similar to Cryptography - Simplified - Hash Functions

The SHA Hashing Algorithm
The SHA Hashing AlgorithmThe SHA Hashing Algorithm
The SHA Hashing AlgorithmBob Landstrom
 
How Hashmap works internally in java
How Hashmap works internally  in javaHow Hashmap works internally  in java
How Hashmap works internally in javaRamakrishna Joshi
 
Hashing Considerations In Web Applications
Hashing Considerations In Web ApplicationsHashing Considerations In Web Applications
Hashing Considerations In Web ApplicationsIslam Heggo
 
A Survey of Password Attacks and Safe Hashing Algorithms
A Survey of Password Attacks and Safe Hashing AlgorithmsA Survey of Password Attacks and Safe Hashing Algorithms
A Survey of Password Attacks and Safe Hashing AlgorithmsIRJET Journal
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptxAgonySingh
 
Data Structure and Algorithms: What is Hash Table ppt
Data Structure and Algorithms: What is Hash Table pptData Structure and Algorithms: What is Hash Table ppt
Data Structure and Algorithms: What is Hash Table pptJUSTFUN40
 
Count based Secured Hash Algorithm.
Count based Secured Hash Algorithm.Count based Secured Hash Algorithm.
Count based Secured Hash Algorithm.IOSR Journals
 

Similar to Cryptography - Simplified - Hash Functions (20)

The SHA Hashing Algorithm
The SHA Hashing AlgorithmThe SHA Hashing Algorithm
The SHA Hashing Algorithm
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
How Hashmap works internally in java
How Hashmap works internally  in javaHow Hashmap works internally  in java
How Hashmap works internally in java
 
Whats A Hash
Whats A HashWhats A Hash
Whats A Hash
 
HASH FUNCTIONS.pdf
HASH FUNCTIONS.pdfHASH FUNCTIONS.pdf
HASH FUNCTIONS.pdf
 
Hashing Considerations In Web Applications
Hashing Considerations In Web ApplicationsHashing Considerations In Web Applications
Hashing Considerations In Web Applications
 
Hashing
HashingHashing
Hashing
 
Hash_Crypto.ppt
Hash_Crypto.pptHash_Crypto.ppt
Hash_Crypto.ppt
 
Ch_07 (1).pptx
Ch_07 (1).pptxCh_07 (1).pptx
Ch_07 (1).pptx
 
A Survey of Password Attacks and Safe Hashing Algorithms
A Survey of Password Attacks and Safe Hashing AlgorithmsA Survey of Password Attacks and Safe Hashing Algorithms
A Survey of Password Attacks and Safe Hashing Algorithms
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 
Data Structure and Algorithms: What is Hash Table ppt
Data Structure and Algorithms: What is Hash Table pptData Structure and Algorithms: What is Hash Table ppt
Data Structure and Algorithms: What is Hash Table ppt
 
Count based Secured Hash Algorithm.
Count based Secured Hash Algorithm.Count based Secured Hash Algorithm.
Count based Secured Hash Algorithm.
 
Hash Function.pdf
Hash Function.pdfHash Function.pdf
Hash Function.pdf
 
Hash pre
Hash preHash pre
Hash pre
 

More from Abdul Manaf Vellakodath

Cryptography - Simplified - Message Integrity
Cryptography - Simplified - Message IntegrityCryptography - Simplified - Message Integrity
Cryptography - Simplified - Message IntegrityAbdul Manaf Vellakodath
 
Cryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric EncryptionCryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric EncryptionAbdul Manaf Vellakodath
 
Cryptography - Simplified - Symmetric Encryption
Cryptography - Simplified - Symmetric EncryptionCryptography - Simplified - Symmetric Encryption
Cryptography - Simplified - Symmetric EncryptionAbdul Manaf Vellakodath
 
Cryptography - Simplified - Key Generation - Asymmetric Keys
Cryptography - Simplified - Key Generation - Asymmetric KeysCryptography - Simplified - Key Generation - Asymmetric Keys
Cryptography - Simplified - Key Generation - Asymmetric KeysAbdul Manaf Vellakodath
 
Cryptography - 5 minutes series - Random Numbers
Cryptography - 5 minutes series - Random NumbersCryptography - 5 minutes series - Random Numbers
Cryptography - 5 minutes series - Random NumbersAbdul Manaf Vellakodath
 

More from Abdul Manaf Vellakodath (6)

information security awareness course
information security awareness courseinformation security awareness course
information security awareness course
 
Cryptography - Simplified - Message Integrity
Cryptography - Simplified - Message IntegrityCryptography - Simplified - Message Integrity
Cryptography - Simplified - Message Integrity
 
Cryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric EncryptionCryptography - Simplified - Asymmetric Encryption
Cryptography - Simplified - Asymmetric Encryption
 
Cryptography - Simplified - Symmetric Encryption
Cryptography - Simplified - Symmetric EncryptionCryptography - Simplified - Symmetric Encryption
Cryptography - Simplified - Symmetric Encryption
 
Cryptography - Simplified - Key Generation - Asymmetric Keys
Cryptography - Simplified - Key Generation - Asymmetric KeysCryptography - Simplified - Key Generation - Asymmetric Keys
Cryptography - Simplified - Key Generation - Asymmetric Keys
 
Cryptography - 5 minutes series - Random Numbers
Cryptography - 5 minutes series - Random NumbersCryptography - 5 minutes series - Random Numbers
Cryptography - 5 minutes series - Random Numbers
 

Recently uploaded

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Cryptography - Simplified - Hash Functions

  • 1. Cryptography - Hash Functions 5 minutes series Abdul Manaf Vellakodath Security Architect
  • 2. Hash functions ● Suppose, you need an identifier that uniquely identifies a document or an installation file, and any change (even a single bit) to the content of the file should completely change the identifier… then you are looking for a Hash function. ● HASH is a one-way function. I.e, you can create a HASH from a message, but you can’t recover (or decipher) the message from the HASH value. ● No two separate message would ever produce the same HASH value. If it does, don’t use that HASH algorithm. ● There are many popular Hash functions. Some of them are: RC4, MD5, SHA1, SHA2, SHA3 etc. ● This document will describe some properties of SHA-2, and explain how a simple HASH function works.
  • 3. HASH Value Creation Hash Algorithm #1 Message Hash (Message Digest) Hello World! #1Hash (Message Digest) MD5 ed076287532e86365e841e92bfc50d8c Hash value of the message “Hello World!” is “ed076287532e86365e841e92bfc50d8c”. If there is a slight change in the message, it will produce a totally separate hash value.
  • 4. HASH Value Verification Hash Algorithm #2 Message Hash (Message Digest) Note that both the message and its corresponding hash value could be replaced by someone in the middle. To protect such ‘man-in-the-middle’ attacks, use HMAC, CBC-MAC, Digital Signatures etc. Repeat the Hash Value Creation process (as before), and then check against the Hash Value received along with the message. If both hash value matches (i.e. #1 = #2), then it is the hash value corresponds to the original message.
  • 5. HASH function (SHA-256) - A very good one! Algorithm SHA-256 Length of hash value 256 bits Operates on 512 bits block Maximum message size (2^64) - 1 (i.e. works on pretty big message sizes) Hash operations A combination of AND, XOR, Rotation, ADD (Mod 2^64), OR, SHR Rounds of operation 64
  • 6. Hash Algorithms (very bad ones, of course!) unsigned xor_hash(void *key, int len) { unsigned char *p = key; unsigned h = 0; int i; for (i = 0; i < len; i++) { h ^= p[i]; } return h; } unsigned add_hash(void *key, int len) { unsigned char *p = key; unsigned h = 0; int i; for (i = 0; i < len; i++) { h += p[i]; } return h; } XOR each of the values together to derive the hash ADD each of the values together to derive the hash These methods are just for illustration purposes only. They are susceptible to collision, as you can imagine, if you jumble up the message, and processed (XOR or ADD), it will yield the same hash value. Therefore, these algorithms are very poor hash functions.