Css Chap3 Techneo
Css Chap3 Techneo
Functions
CHAPTER 3
3-2
Dlsadvantages of HMAC
Code (CMAC)
Key-generator for last step
1 We cannot use the Hash-bascd Message CMAC is a keyed hash function that is based on a (1B27)Fig. 3.14: CMAC
Authentication Code in case of more than onc symmetric key block cipher, such as te
one-way password file. It can be used for intrusion
receiver because HMAC uses the symmetric key Advanced Encryption Standard. CMAC A 3.1.6 Cryptographic Hash Functions
detection and virus detection. A cryptographic
lo generate MAC.
equivalent to the CBC mode of block cipher sea UQ. What are the requirements of the cryptographic bash function can be used to construct a
2. If we share the symmetric with multiple parties, in first section of this chapter. CMACis a blodt hash functions? Compare MD5 and SHA Hash ! pseudorandom function (PRF or a pseudorandom
there is no way the receiver to know that the
cipher-based MAC algorithm. It may be used
functions. MU-May19
number generator (PRNG) also. A common
message was prepared and sent by the which
sender, also there is a possibility of not sharing the provide assurance of the authenticity and, henc: A eryptographic hash function Haccepts a application for a hash-based PRF is for the
the integrity of binary data. As shown in variable-1length block of data M as input and generation of symmetric keys.
keys by some receivers. So, there is the possibility
of fraud that one of the receivers may create false Fig. 3.1.4., one block of MAC is created from ) produces a fixed-size hash value (message digest),
There are two categories of possible attacks on
h= H(M). The principal object of ahash function
messageS. blocks of plaintext using symmetric key cipher N hash functions, brute-force and cryptanalysis. A
is data integrity. A change to any bit or bits in M
3. There is also a need for periodic refreshments of times. brute-force attack uses trial-and-error to guess the
keys.
would result in a change to the message digest.
Here, the message is divided into N blocks. Every encryption keys. Attackers work through all
Hash functions are commonly used to
create a
block is mbits long. The final CMAC generated possible combinations hoping to guess correctly. It
(MU-New Syllabus wef academic year 21-22)(M6-71) Tech-Neo Publications..A SACHIN SHAH Ventu (MU-New Syllabus w.e.f academic year
21-22)(M6-71) Tech-Neo Publications...A SACHIN SHAH Venture
(Cryptographic Hash Functions) ..Page no. (3-7)
(Cryptographic Hash Functions)..
Cryptography&Systen
Security
(MU-Sem.6-Comp)
In other words, for a hash
.Ph,ageit isno. Security
(MU-Sem.6-Comp)
Initialize MD Buffer
on the specific
algorithm but function h Cryptography & System
hashing algorithm
3.
into multiple
blocks
does not depend Jength. the case of a hash find any two different inputs x and y The MDS
message-digest
broken down The entire string
is converted
dependsonlyon bit b(x) = h(y). such t
processes data in
512-bit strings,
each. You also
need to initialize four
depends only on the composed of 32 bits each. The of 512 bits and D.
namely A, B, C,.
brute-forreattack into 16 words message-digest different buffers,
function. a Since, hash function is compressing
bit length
of the
is an
hash vajue
based
attack
Acryptanalysis, in
weaknesses in a fixed hash length. it is impossible for a
to have collisions. This
funcion w output from MD5
value.
is a l28-bit
thanks to
These buffers are 32
as follows :
bits each and are
initialized
(MU-New Syllabus w.e.f academic year 21-22)(M6-71) Tech-Neo Publications...A SACHIN SHAH Venture
MU-New Syllabus wefacagemic year SHAH Venture
21-22)(M6-71) Tech-Neo Publications..A SACHIN
Security
(MU-Sem.6-Comp) (Gryptographic Hash Fuunctions).. .Page no.
Cryptography &System
with special functions. If other message blocks M (31 (Cryptographic Hash Functions) Page no. (3-11)
blocks, and are generated
(ROTR), right shifts (SHR) process (message schedule. big remain, repcat Cryptography &System Security
(MU-Sem.6-Comp)
processing 1024-bit
mixing right rotations shuffle, buffer
Step 4: Message
and exclusive ORs (). the new hash H') creation Step 3:Initialize hash
The algorithm works in a way
where it processes
(128-word) blocks
algorithmn is a module that
If W was the last message schedule, then L The main part of the
Step 2:The big shuffle each block of 1024 bits from
thc message using module is labelled F in
is message M's final hash or digest. consists of 80 rounds; this
schedule W are fed. block. This can cause
The input blocks of message the result from thc previous the Fig.3.3.5 Each round
necds three things: one
1024-bit block which can"
one after the other, to a function
represented A 3.3.2 SHA-512 aproblem for the first Word, the output of the previous Round, and a
previous processing. for the same is
below as a graph. Iuse the result from any SHA-512 constant. The logic
SHA-512 version of SHA creates 512-bit solved by using a default
The graph takes as inputs a hash o'()
and a This problem can be depicted in Fig. 3.3.7.
digest from
multiple-block message. Like
message schedule input block W(), and outputs a versions the SHA family of
mes ag value tobe used for the first
block in order to start
intermediate result needs to Each round takes as input the
512-bit buffer value
algorithms, this ver off the process. Each the buffer.
hash o(+1). The initial hash o (0) fed to the is also based on the iterated hash hold (abcdefgh) and updates the contents of
the next block. To
function, Merkl be used in processing The first Round doesn't have a
previous round's
graph is the intermediate hash H' in the case of Damgard scheme. As shown in
the Fig. 3.35 intermediate and final results of the hash function. output from the
output, so it uses the final
w, it's H" defined in the pre-processing step. block is 1024 bits in length. Following are the A512-bit buffer is used.
previous message processing phase
for the
o'0 and w'o) produce o); in turn o) and followed to create a message digest: represented as eight 64-bit previous block of 1024 bits.
The buffer can be are
w) produce o2), etc., until o(63) is produced. d, e, f, g, h). These registers Mod:
Step 1: Append padding bits registers (a, b, c,
64-bit integers For the first Round of the first block (1024 bits) of
1 initialized to the following Initial Vector (IV) is used.
W
SHA-512 can't hash a message input of any sipe obtained by the formatted input, the
(hexadecimal values) which were the value
i.e., it has an input size limit. The message neet
sixty-four bits of the fractional At input to the first round, the buffer has
H 63 to be padded so that its length is congruent to Rl taking the first
first 8 prime of the intermediate hash value, H,-j. Each round t
parts of the square roots of the makes use of a 64-bit value W, derived from
the
modulo 1024 [length =896(mod 1024)1. are
numbers (2,3,5,7,|1,13,1 7, 19). These values
Even if the message is already of the desire current l024-bit block being processed (Mi).
called the Initial Vectors (IV).:
length, Padding is always added. Thus, the These values are derived using a message
Buffer Value (in
number of padding bits is in the range of l t Buffer Value (in schedule described subsequently. Each round also
1024. The padding consists of a single 1 bi hexadecimal) hexadecimal) makes use of an additive constant K,, where 0<t
followed by the necessary number of 0 bils <79 indicates one of the 80 rounds. Since there
6A09E667F3BCC908 e 510E527FADE682D1
are 80 Rounds and each of them needs one of
M. (100000.000).
BB67AE8584CAA73B 9BO5688C2B3E6C1F these constants.
Step 2:Append length
Queue A block of 128 bits is appended to the message. C 3C6EF372FE94F82B 1F83D9ABFB41BD6B
These words represent the first 64 bits of the
fractional parts of the cube roots of the first 80
This block is treated as an unsigned 128-b1 A54FF53A5F1D36F1 prime numbers. The output of the eightieth round
h 5BE0CD19137E2179
IB1) Fig. 3.3.4 : Shuffling
integer (most significant byte first) and contains is added to the input to the first round (H, ) to
Step 3: New hash Hash Buffer produce Hi.
the length of the original message (before the
The addition is done independently for each of the
After all input blocks from Whave been used padding). Register a Register e
and we o(63) has been created, we can create the eight words in the buffer with each of the
The outcome of the first two steps yields
new hash Hsuch that cach input block of His the Register b Register f corresponding words in H, 1 using addition
message that is an integer multiple of 1024 bits ID
sum of the coresponding input block of H plus modulo 264. This process is repeated for 80
length. In Fig., the expanded message Register c
the coresponding input block of o(63): Register g Rounds. After the 80" Round, its output is simply
represented as the sequence of 1024-bit blocks added to the result of the
H) =#)+o63)0) M1, M2, . MN, So that the total length of the Register d Register h previous message
where + is the addition modulo 2 processing phase to get the final result for this
expanded message is N* 1024 bits. (1832)
iteration of message processing.
(MU-New Syllabus wef academic year (MU-New Syllabus w.e.f academic year
21-22)(M6-71) a Tech-Neo Publications.A SACHIN SHAH Ventut 21-22)(M6-71) ITech-Neo
Publications..A SACHIN SHAH Venture
no. (3-13)
(MU-Sem.6-Comp) (Cryptographic Hash Functions)....Page
Cryptography & System Security
Step 5: Output
(Cryptographic Hashn
Functions). . Page no. (3-12 Cvptography &System Security
(MU-Sem.6-Comp)
After allN 1024-bit blocks have been processed, the output fromthe N"stage is the 512-bit
So, the intermediate results are all used from each block for processing the next block. And when
message diges H, 4
1024-bit block has finished being processed, we have with us the final result of the SHA-512 algorithhe finga SMessage
schedue
our original message. Ko
W, ROund 0
Nx 1024bits
L bits 128 bits
Message 1000000..o L
K.
W
Roundt
M M Ma
K79
W79 Round 79
H H
(1833)Fig. 3.3.5: Message Digest creation using SHA-512 1024-bit block in SHA-512
(1B34)Fig. 3.3.6: Processing of a single
Finally, SHA-512 can be summarized as : bC d e f 9
H,= IV Maj Ch
Hi = SUM64(H; -1, abcdefgh;)
MD = HN
where
processing of the i K
IV =initial value of the abcdefgh buffer and abcdefgh; = the output of the last round of
message block
fields)
N=the number of blocks in the message (including padding and length
modulo 264 performed separately on each word of the pair of inputs
SUMA = addition
512 bits
MD = final message digest value
(MU-New Syllabus w.e.f academic year 21-22)(M6-71) Tech-Neo Publications..A SACHIN SHAH Ventur
(MU-New Syllabus w.e.f academic year
21-22)(M6-71) Tech-NeoPublications..A SACHIN SHAH Ventre
Q.
5 Q. 3 Q.2
4 Q.
Q.
1
Cryptography
Differentiate SHA
WhatExplain Compare
bits64
are provides
steps (1B36)Fig. &
the and System
SHA-256
between
and
requirements in contrast
better
MD5 1024
bits
3.3.8: Security
security MË
algorithm. HMAC Creation (MU-Sem.6-Comp)
of
the than and of W45
cryptographic MD.CMAC. 80-word
SHA-512. Descriptive
Questions
Justify. W16 Wo
Input Wy
Sequencefor Wg
hash
W14
functions?
Processing
SHA-512of W-16
Functions)...P
(Cryptographic
W-15
Compare W
W-7
W:2
MD5
Hash
Single W63W65
and
SHA Block LJ
79 l W7W716
ChapterEnds. Hash
(R1Page
no.
functions
D00
(May 19)