SlideShare a Scribd company logo
Message Digest Algorithm : SHA-1
Shiva Ram Dam
MSc Information System Engineering
June 12, 2019
Pokhara University
Nepal
Introduction
• SHA1: Secure Hash Algorithm 1
• Designed by the United States National Security Agency
• Produces hash value known as Message Digest
2June 12, 2019 SHA-1 Algorithm
Salient Features
• Works for any input message that is less than 264 bits
• produces160 bits length message digest
• Infeasible to retain the original message from the message digest
• Same message digest to be produced from both sender and
receiver
• Purpose: Authentication , not Encryption
• widely used in security applications and protocols, including TLS,
SSL, PGP, SSH, IPSec and S/MIME
3June 12, 2019 SHA-1 Algorithm
Message-Hashcode Example
abc
Abc
4June 12, 2019 SHA-1 Algorithm
a9993e36-4706816a-ba3e2571-
7850c26c-9cd0d89d
915858af-a2278f25-527f1920-
38108346-164b47f2
SHA
Abstract view of SHA
• Input to the SHA can be of
arbitrary length.
• Produces fixed length output
(i.e. 160 bits length)
June 12, 2019 SHA-1 Algorithm 5
SHA 1
Arbitrary Length
H(X)
160 bits
X
Steps:
1. Append padding bits
2. Append Length
3. Initialize hash bufffer
4. SHA processing
5. Output
June 12, 2019 SHA-1 Algorithm 6
Padding
X (X1, X2, ….Xn)
Compression
Function
512
bits
160 bits
H(X)
160 bits
1. Padding
Process of adding extra bits (i.e. 0
followed after a 1)
June 12, 2019 SHA-1 Algorithm 7
Padding
X (X1, X2, ….Xn)
Compression
Function
512
bits
160 bits
H(X)
160 bits
Fig: Padding of string "abc" in bits
2. Appending length
• After padding, length of the
message is represented in 24
bit
• In total, the string is a multiple
of 512 bits.
June 12, 2019 SHA-1 Algorithm 8
Padding
X (X1, X2, ….Xn)
Compression
Function
512
bits
160 bits
H(X)
160 bits
Fig: Padding of string "abc" in bits, finalized by the length
of the string, which is 24 bits
• This 512 bits input to the
compression function
• The message divided into 16
words.
• Each word consists of 32 bits.
• 512/32 =16 words
June 12, 2019 SHA-1 Algorithm 9
Padding
X (X1, X2, ….Xn)
Compression
Function
512
bits
160 bits
H(X)
160 bits
3. Initialize hash buffer
Initial values of Ho are predefined
and stored in registers ABCDE
These initial values are used in
Round 0.
June 12, 2019 SHA-1 Algorithm 10
H Hex values
Ho(A) 01234567
Ho(B) 89ABCDEF
Ho(C) FEDCBA98
Ho(D) 76543210
Ho(E) C3D2E1F0
Source:
https://www.researchgate.net/publication/238180532_An_Architecture_for_a
_SHA1_Applied_for_DSA/figures?lo=1
CF
4. SHA Processing
SHA1 has 80 rounds defined.
The Message Scheduler Algorithm
schedules each word to rounds as:
• W0 Round 0
• W1 Round 1
……
• W15 Round 15
• W16 Round 16
…..
• W79 Round 79
June 12, 2019 SHA-1 Algorithm 11
Wt is
calculatedSource:
https://www.researchgate.net/publication/238180532_An_Architecture_for_a
_SHA1_Applied_for_DSA/figures?lo=1
Word assigning to rounds:
4. SHA Processing (contd.)
June 12, 2019 SHA-1 Algorithm 12
Source:
https://www.researchgate.net/publication/238180532_An_Architecture_for_a
_SHA1_Applied_for_DSA/figures?lo=1
Word assigning to round 0:
4. SHA Processing (contd.)
June 12, 2019 SHA-1 Algorithm 13
Source:
https://www.researchgate.net/publication/238180532_An_Architecture_for_a
_SHA1_Applied_for_DSA/figures?lo=1
Word assigning to other rounds:
For others (i.e round 16- 79)
W[t] = S1(w[t-16] XOR W[t-14] XOR W[t-8] XOR W[t-3])
For example: when round is 16,
• W[16] = S1(w[16-16] XOR W[16-14] XOR W[16-8] XOR W[16-3])
• Here W0, W2, W8 and W13 are XORed.
• The output is the new word for round 16.
4. SHA Processing (contd.)
Stages Round
t=1 0 to 19
t=2 20 to 39
t=3 40 to 59
t=4 60 to 79
June 12, 2019 SHA-1 Algorithm 14
Each stage has 20 rounds.
Source:
https://www.researchgate.net/publication/238180532_An_Architecture_for_a
_SHA1_Applied_for_DSA/figures?lo=1
Division of stages:
4. SHA Processing (contd.)
At each stage:
June 12, 2019 SHA-1 Algorithm 15
Stage Predefined value of k
t1 K1=0X5A827999
t2 K2= 0X6ED9EBA1
t3 K3=0X8F1BBCDC
t4 K4=0XCA62C1D6
Source:
https://www.researchgate.net/publication/238180532_An_Architecture_for_a
_SHA1_Applied_for_DSA/figures?lo=1
Constant values:
4. SHA Processing (contd.)
Each round takes 3 inputs:
• 32 bit word form 512 bit block
(i.e.Wt)
• The values from register
ABCDE
• Constant Kt
June 12, 2019 SHA-1 Algorithm 16
Source:
https://www.researchgate.net/publication/238180532_An_Architecture_for_a
_SHA1_Applied_for_DSA/figures?lo=1
Process in each round:
4. SHA Processing (contd.)
Stage Ft
t1 Ft(B.C,D) = (B AND C) OR ((NOT B)
AND D)
t2 Ft(B.C,D) = B XOR C XOR D
t3 Ft(B.C,D) = (B AND C) OR (B AND D)
OR (C AND D)
t4 Ft(B.C,D) = B XOR C XOR D
June 12, 2019 SHA-1 Algorithm 17
Source: https://en.wikipediaorg/wiki/SHA-1
Ft at different stages:
4. SHA Processing (contd.)
June 12, 2019 SHA-1 Algorithm 18
Source: https://en.wikipediaorg/wiki/SHA-1
• Output of Ft and E are added
• Value in register A is 5 bit circular-left
shifted.
• This then added to previous sum.
• Wt is added
• Kt introduced
• B is circular-left shifted by 30 bits.
New values for next round
At each Round:
Denotes addition module 232
5. The Output
June 12, 2019 SHA-1 Algorithm 19
• The 160 bit output from the final
round is modulo added to the initial
predefined values of Ho at registers
ABCDE.
• Output obtained thus is a 160 bit
hash code.
After Final Round:
InitialvaluesofHo
atABCDE
32 bits 32 bits 32 bits 32 bits 32 bits
H(X)
160 bits
References
• https://resources.saylor.org/wwwresources/archived/site/wp-
content/uploads/2012/07/SHA-1-1.pdf
• https://www.youtube.com/watch?v=YCf80-8xhGs
• https://www.slideshare.net/karteek10/secure-hashing-algorithm
• https://slideplayer.com/slide/8199025/
• https://www.slideshare.net/VishakhaAgarwal4/secure-hash-algorithm
• https://brilliant.org/wiki/secure-hashing-algorithms/
• https://en.wikipedia.org/wiki/SHA-1
20June 12, 2019 SHA-1 Algorithm
QA session
21June 12, 2019 SHA-1 Algorithm
Thank You
22June 12, 2019 SHA-1 Algorithm

More Related Content

What's hot

CMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signatureCMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signature
Adarsh Patel
 
Hashing
HashingHashing
Rc4
Rc4Rc4
How Hashing Algorithms Work
How Hashing Algorithms WorkHow Hashing Algorithms Work
How Hashing Algorithms Work
CheapSSLsecurity
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
harshit chavda
 
MD-5 : Algorithm
MD-5 : AlgorithmMD-5 : Algorithm
MD-5 : Algorithm
Sahil Kureel
 
Modern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key CipherModern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key Cipher
Mahbubur Rahman
 
Hash function
Hash function Hash function
Hash function
Salman Memon
 
Product Cipher
Product CipherProduct Cipher
Product Cipher
SHUBHA CHATURVEDI
 
block ciphers
block ciphersblock ciphers
block ciphers
Asad Ali
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
Dr.Florence Dayana
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
DarshanPatil82
 
Data encryption standard
Data encryption standardData encryption standard
Data encryption standard
Vasuki Ramasamy
 
Idea(international data encryption algorithm)
Idea(international data encryption algorithm)Idea(international data encryption algorithm)
Idea(international data encryption algorithm)
SAurabh PRajapati
 
SHA512.pptx
SHA512.pptxSHA512.pptx
SHA512.pptx
ssuserb4287c
 
Web Security
Web SecurityWeb Security
Web Security
Dr.Florence Dayana
 
Cryptographic hash function md5
Cryptographic hash function md5Cryptographic hash function md5
Cryptographic hash function md5
Khulna University, Khulna, Bangladesh
 
Elliptic curve cryptography
Elliptic curve cryptographyElliptic curve cryptography
Elliptic curve cryptography
Cysinfo Cyber Security Community
 

What's hot (20)

CMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signatureCMACs and MACS based on block ciphers, Digital signature
CMACs and MACS based on block ciphers, Digital signature
 
Secure hashing algorithm
Secure hashing algorithmSecure hashing algorithm
Secure hashing algorithm
 
Hashing
HashingHashing
Hashing
 
Rc4
Rc4Rc4
Rc4
 
How Hashing Algorithms Work
How Hashing Algorithms WorkHow Hashing Algorithms Work
How Hashing Algorithms Work
 
Block cipher modes of operation
Block cipher modes of operation Block cipher modes of operation
Block cipher modes of operation
 
MD-5 : Algorithm
MD-5 : AlgorithmMD-5 : Algorithm
MD-5 : Algorithm
 
Modern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key CipherModern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key Cipher
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Hash function
Hash function Hash function
Hash function
 
Product Cipher
Product CipherProduct Cipher
Product Cipher
 
block ciphers
block ciphersblock ciphers
block ciphers
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
 
Data encryption standard
Data encryption standardData encryption standard
Data encryption standard
 
Idea(international data encryption algorithm)
Idea(international data encryption algorithm)Idea(international data encryption algorithm)
Idea(international data encryption algorithm)
 
SHA512.pptx
SHA512.pptxSHA512.pptx
SHA512.pptx
 
Web Security
Web SecurityWeb Security
Web Security
 
Cryptographic hash function md5
Cryptographic hash function md5Cryptographic hash function md5
Cryptographic hash function md5
 
Elliptic curve cryptography
Elliptic curve cryptographyElliptic curve cryptography
Elliptic curve cryptography
 

Similar to SHA 1 Algorithm

IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET Journal
 
Sha
ShaSha
Sha
ha123
 
Data streaming algorithms
Data streaming algorithmsData streaming algorithms
Data streaming algorithms
Hridyesh Bisht
 
A Comparative Analysis between SHA and MD5 algorithms
A Comparative Analysis between SHA and MD5 algorithms A Comparative Analysis between SHA and MD5 algorithms
A Comparative Analysis between SHA and MD5 algorithms
Er Piyush Gupta IN ⊞⌘
 
SHA
SHASHA
Information and network security 39 secure hash algorithm
Information and network security 39 secure hash algorithmInformation and network security 39 secure hash algorithm
Information and network security 39 secure hash algorithm
Vaibhav Khanna
 
An Overview of the ATSC 3.0 Physical Layer Specification
An Overview of the ATSC 3.0 Physical Layer SpecificationAn Overview of the ATSC 3.0 Physical Layer Specification
An Overview of the ATSC 3.0 Physical Layer Specification
Alwin Poulose
 
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Dr. Loganathan R
 
GOLDSTRIKETM 1: COINTERRA’S FIRST GENERATION CRYPTO-CURRENCY PROCESSOR FOR BI...
GOLDSTRIKETM 1: COINTERRA’S FIRST GENERATION CRYPTO-CURRENCY PROCESSOR FOR BI...GOLDSTRIKETM 1: COINTERRA’S FIRST GENERATION CRYPTO-CURRENCY PROCESSOR FOR BI...
GOLDSTRIKETM 1: COINTERRA’S FIRST GENERATION CRYPTO-CURRENCY PROCESSOR FOR BI...
Javed Barkatullah
 
introduction to MD5 Massage Digest Algorithm.ppt
introduction to MD5 Massage Digest Algorithm.pptintroduction to MD5 Massage Digest Algorithm.ppt
introduction to MD5 Massage Digest Algorithm.ppt
madlord2
 
8 bit Microprocessor with Single Vectored Interrupt
8 bit Microprocessor with Single Vectored Interrupt8 bit Microprocessor with Single Vectored Interrupt
8 bit Microprocessor with Single Vectored Interrupt
Hardik Manocha
 
4bit PC report
4bit PC report4bit PC report
4bit PC report
tanvin
 
4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]
shibbirtanvin
 
80x86_2.pdf
80x86_2.pdf80x86_2.pdf
80x86_2.pdf
rajinooka
 
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTSPERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
ijcisjournal
 
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTSPERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
ijcisjournal
 
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTSPERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
ijcisjournal
 
FPGA DESIGN FOR H.264/AVC ENCODER
FPGA DESIGN FOR H.264/AVC ENCODERFPGA DESIGN FOR H.264/AVC ENCODER
FPGA DESIGN FOR H.264/AVC ENCODER
IJCSEA Journal
 
SHA-3
SHA-3SHA-3

Similar to SHA 1 Algorithm (20)

IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
IRJET- Low Power and Simple Implementation of Secure Hashing Algorithm (SHA-2...
 
Sha
ShaSha
Sha
 
Data streaming algorithms
Data streaming algorithmsData streaming algorithms
Data streaming algorithms
 
A Comparative Analysis between SHA and MD5 algorithms
A Comparative Analysis between SHA and MD5 algorithms A Comparative Analysis between SHA and MD5 algorithms
A Comparative Analysis between SHA and MD5 algorithms
 
SHA
SHASHA
SHA
 
Information and network security 39 secure hash algorithm
Information and network security 39 secure hash algorithmInformation and network security 39 secure hash algorithm
Information and network security 39 secure hash algorithm
 
An Overview of the ATSC 3.0 Physical Layer Specification
An Overview of the ATSC 3.0 Physical Layer SpecificationAn Overview of the ATSC 3.0 Physical Layer Specification
An Overview of the ATSC 3.0 Physical Layer Specification
 
Ch12
Ch12Ch12
Ch12
 
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...
 
GOLDSTRIKETM 1: COINTERRA’S FIRST GENERATION CRYPTO-CURRENCY PROCESSOR FOR BI...
GOLDSTRIKETM 1: COINTERRA’S FIRST GENERATION CRYPTO-CURRENCY PROCESSOR FOR BI...GOLDSTRIKETM 1: COINTERRA’S FIRST GENERATION CRYPTO-CURRENCY PROCESSOR FOR BI...
GOLDSTRIKETM 1: COINTERRA’S FIRST GENERATION CRYPTO-CURRENCY PROCESSOR FOR BI...
 
introduction to MD5 Massage Digest Algorithm.ppt
introduction to MD5 Massage Digest Algorithm.pptintroduction to MD5 Massage Digest Algorithm.ppt
introduction to MD5 Massage Digest Algorithm.ppt
 
8 bit Microprocessor with Single Vectored Interrupt
8 bit Microprocessor with Single Vectored Interrupt8 bit Microprocessor with Single Vectored Interrupt
8 bit Microprocessor with Single Vectored Interrupt
 
4bit PC report
4bit PC report4bit PC report
4bit PC report
 
4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]
 
80x86_2.pdf
80x86_2.pdf80x86_2.pdf
80x86_2.pdf
 
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTSPERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
 
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTSPERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
 
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTSPERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
PERFORMANCE ANALYSIS OF SHA-2 AND SHA-3 FINALISTS
 
FPGA DESIGN FOR H.264/AVC ENCODER
FPGA DESIGN FOR H.264/AVC ENCODERFPGA DESIGN FOR H.264/AVC ENCODER
FPGA DESIGN FOR H.264/AVC ENCODER
 
SHA-3
SHA-3SHA-3
SHA-3
 

Recently uploaded

Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 

Recently uploaded (20)

Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 

SHA 1 Algorithm

  • 1. Message Digest Algorithm : SHA-1 Shiva Ram Dam MSc Information System Engineering June 12, 2019 Pokhara University Nepal
  • 2. Introduction • SHA1: Secure Hash Algorithm 1 • Designed by the United States National Security Agency • Produces hash value known as Message Digest 2June 12, 2019 SHA-1 Algorithm
  • 3. Salient Features • Works for any input message that is less than 264 bits • produces160 bits length message digest • Infeasible to retain the original message from the message digest • Same message digest to be produced from both sender and receiver • Purpose: Authentication , not Encryption • widely used in security applications and protocols, including TLS, SSL, PGP, SSH, IPSec and S/MIME 3June 12, 2019 SHA-1 Algorithm
  • 4. Message-Hashcode Example abc Abc 4June 12, 2019 SHA-1 Algorithm a9993e36-4706816a-ba3e2571- 7850c26c-9cd0d89d 915858af-a2278f25-527f1920- 38108346-164b47f2 SHA
  • 5. Abstract view of SHA • Input to the SHA can be of arbitrary length. • Produces fixed length output (i.e. 160 bits length) June 12, 2019 SHA-1 Algorithm 5 SHA 1 Arbitrary Length H(X) 160 bits X
  • 6. Steps: 1. Append padding bits 2. Append Length 3. Initialize hash bufffer 4. SHA processing 5. Output June 12, 2019 SHA-1 Algorithm 6 Padding X (X1, X2, ….Xn) Compression Function 512 bits 160 bits H(X) 160 bits
  • 7. 1. Padding Process of adding extra bits (i.e. 0 followed after a 1) June 12, 2019 SHA-1 Algorithm 7 Padding X (X1, X2, ….Xn) Compression Function 512 bits 160 bits H(X) 160 bits Fig: Padding of string "abc" in bits
  • 8. 2. Appending length • After padding, length of the message is represented in 24 bit • In total, the string is a multiple of 512 bits. June 12, 2019 SHA-1 Algorithm 8 Padding X (X1, X2, ….Xn) Compression Function 512 bits 160 bits H(X) 160 bits Fig: Padding of string "abc" in bits, finalized by the length of the string, which is 24 bits
  • 9. • This 512 bits input to the compression function • The message divided into 16 words. • Each word consists of 32 bits. • 512/32 =16 words June 12, 2019 SHA-1 Algorithm 9 Padding X (X1, X2, ….Xn) Compression Function 512 bits 160 bits H(X) 160 bits
  • 10. 3. Initialize hash buffer Initial values of Ho are predefined and stored in registers ABCDE These initial values are used in Round 0. June 12, 2019 SHA-1 Algorithm 10 H Hex values Ho(A) 01234567 Ho(B) 89ABCDEF Ho(C) FEDCBA98 Ho(D) 76543210 Ho(E) C3D2E1F0 Source: https://www.researchgate.net/publication/238180532_An_Architecture_for_a _SHA1_Applied_for_DSA/figures?lo=1 CF
  • 11. 4. SHA Processing SHA1 has 80 rounds defined. The Message Scheduler Algorithm schedules each word to rounds as: • W0 Round 0 • W1 Round 1 …… • W15 Round 15 • W16 Round 16 ….. • W79 Round 79 June 12, 2019 SHA-1 Algorithm 11 Wt is calculatedSource: https://www.researchgate.net/publication/238180532_An_Architecture_for_a _SHA1_Applied_for_DSA/figures?lo=1 Word assigning to rounds:
  • 12. 4. SHA Processing (contd.) June 12, 2019 SHA-1 Algorithm 12 Source: https://www.researchgate.net/publication/238180532_An_Architecture_for_a _SHA1_Applied_for_DSA/figures?lo=1 Word assigning to round 0:
  • 13. 4. SHA Processing (contd.) June 12, 2019 SHA-1 Algorithm 13 Source: https://www.researchgate.net/publication/238180532_An_Architecture_for_a _SHA1_Applied_for_DSA/figures?lo=1 Word assigning to other rounds: For others (i.e round 16- 79) W[t] = S1(w[t-16] XOR W[t-14] XOR W[t-8] XOR W[t-3]) For example: when round is 16, • W[16] = S1(w[16-16] XOR W[16-14] XOR W[16-8] XOR W[16-3]) • Here W0, W2, W8 and W13 are XORed. • The output is the new word for round 16.
  • 14. 4. SHA Processing (contd.) Stages Round t=1 0 to 19 t=2 20 to 39 t=3 40 to 59 t=4 60 to 79 June 12, 2019 SHA-1 Algorithm 14 Each stage has 20 rounds. Source: https://www.researchgate.net/publication/238180532_An_Architecture_for_a _SHA1_Applied_for_DSA/figures?lo=1 Division of stages:
  • 15. 4. SHA Processing (contd.) At each stage: June 12, 2019 SHA-1 Algorithm 15 Stage Predefined value of k t1 K1=0X5A827999 t2 K2= 0X6ED9EBA1 t3 K3=0X8F1BBCDC t4 K4=0XCA62C1D6 Source: https://www.researchgate.net/publication/238180532_An_Architecture_for_a _SHA1_Applied_for_DSA/figures?lo=1 Constant values:
  • 16. 4. SHA Processing (contd.) Each round takes 3 inputs: • 32 bit word form 512 bit block (i.e.Wt) • The values from register ABCDE • Constant Kt June 12, 2019 SHA-1 Algorithm 16 Source: https://www.researchgate.net/publication/238180532_An_Architecture_for_a _SHA1_Applied_for_DSA/figures?lo=1 Process in each round:
  • 17. 4. SHA Processing (contd.) Stage Ft t1 Ft(B.C,D) = (B AND C) OR ((NOT B) AND D) t2 Ft(B.C,D) = B XOR C XOR D t3 Ft(B.C,D) = (B AND C) OR (B AND D) OR (C AND D) t4 Ft(B.C,D) = B XOR C XOR D June 12, 2019 SHA-1 Algorithm 17 Source: https://en.wikipediaorg/wiki/SHA-1 Ft at different stages:
  • 18. 4. SHA Processing (contd.) June 12, 2019 SHA-1 Algorithm 18 Source: https://en.wikipediaorg/wiki/SHA-1 • Output of Ft and E are added • Value in register A is 5 bit circular-left shifted. • This then added to previous sum. • Wt is added • Kt introduced • B is circular-left shifted by 30 bits. New values for next round At each Round: Denotes addition module 232
  • 19. 5. The Output June 12, 2019 SHA-1 Algorithm 19 • The 160 bit output from the final round is modulo added to the initial predefined values of Ho at registers ABCDE. • Output obtained thus is a 160 bit hash code. After Final Round: InitialvaluesofHo atABCDE 32 bits 32 bits 32 bits 32 bits 32 bits H(X) 160 bits
  • 20. References • https://resources.saylor.org/wwwresources/archived/site/wp- content/uploads/2012/07/SHA-1-1.pdf • https://www.youtube.com/watch?v=YCf80-8xhGs • https://www.slideshare.net/karteek10/secure-hashing-algorithm • https://slideplayer.com/slide/8199025/ • https://www.slideshare.net/VishakhaAgarwal4/secure-hash-algorithm • https://brilliant.org/wiki/secure-hashing-algorithms/ • https://en.wikipedia.org/wiki/SHA-1 20June 12, 2019 SHA-1 Algorithm
  • 21. QA session 21June 12, 2019 SHA-1 Algorithm
  • 22. Thank You 22June 12, 2019 SHA-1 Algorithm