Hash Functions: From: Chapter 5 (Book 1) by Dr. Shashikala
Hash Functions: From: Chapter 5 (Book 1) by Dr. Shashikala
• Alice signs a message M by using her private key to "encrypt," that is, she
computes S =[M]Alice · If Alice sends M and S to Bob, then Bob can verify the
signature by verifying that M = {S}Alice, if M is large, [M] Alice is costly to
compute.
• If a cryptographic function h, Alice will sign M by first hashing M then signing
the hash, that is, Alice computes S = [h(M)]Alice. Hashes are efficient
(comparable to block cipher algorithms), and only a small number of bits need
to be signed.
• Then Alice can send Bob M and S, as illustrated in Figure. Bob verifies the
signature by hashing M and comparing the result to the value obtained when
Alice's public key is applied to S. That is, Bob verifies that h(M) = {S}Alice.
Birthday Paradox
• How many people must be there in a room to
make the probability 100% that at-least two
people in the room have same birthday?
512-bit Blocks
64-bit Words
192-bit Hash
Stages
• Save ABC
• Pass 1, Key Schedule 1
• Pass 2, Key Schedule 2
• Pass 3
• feed-forward ABC
Save ABC
• ABC are initially salted with speical values.
• At the beginning of each successive round ABC
are saved for later use with feed-forward.
• 64_bit_word aa = a, bb = b, cc = c;
Pass 1, detail
• 1 pass = 8 rounds, 1 for each 64-bit word
• 64-bit words (keys) referred to as x0 - x7
c=c^x
a = a – (s1[c1] ^ s2[c3] ^ s3[c5] ^ s4[c7])
b = b + (s4[c2] ^ s3[c4] ^ s2[c6] ^ s1[c8])
b = b * multiplier
• ^ denotes XOR
S-Boxes
• s-boxes compose a non-linear function
• map from 8 bits into 64.
• a = a ^ aa ;
• b = b - bb ;
• c = c + cc ;
Tiger Outer Round:
• The input X is padded to a multiple of 512 bits
and written as
• X = (X0,X1,…,Xn-1)
– Employs one outer round for each Xi
– Initial (a,b,c) constants.
– The final (a, b, c) output from one round is the
initial triple for the subsequent
• round and the final (a, b, c) from the final round
is the 192-bit hash value.
• In Outer round, input to
outer round F5 is
(a,b,c).
• The output of F5 as
(a,b,c), the input toF7 is
(c,a,b), the input to F9 is
(b,c,a).
• Each function Fm
consists of eight inner
rounds.
Tiger Inner Rounds
• Each Fm consists of precisely 8 inner rounds.
• 512 bit input W to Fm
– W=(w0,w1,…,w7)
– W is one of the input blocks Xi ➢ All lines are 64 bits
• The input values for fm,i, for i=0,1,2,…,7 are
Tiger Hash: One Round
• Each fm,i is a function of a,b,c,wi and m
– Input values of a,b,c from previous round.
– And wi is 64-bit block of 512 bit W.
– Subscript m is mul tiplier
– And c = (c0,c1,…,c7)
• Output of fm,i is
• Authentication (HMAC)
• Message integrity (HMAC)
• Message fingerprint
• Data corruption detection
• Digital signature efficiency
• Anything you can do with symmetric crypto
• Also, many, many clever/surprising uses…
Online Bids
• Suppose Alice, Bob and Charlie are bidders
• Alice plans to bid A, Bob B and Charlie C
• They don’t trust that bids will stay secret
• A possible solution?
– Alice, Bob, Charlie submit hashes h(A), h(B), h(C)
– All hashes received and posted online
– Then bids A, B, and C submitted and revealed
• Advantage of online bid
– Hashes don’t reveal bids (one way)
– Can’t change bid after hash sent (collision)
• Limitation of online bid
– it is subject to a forward search attack.
– Fortunately, there is an easy fix that will prevent a
forward search, with no cryptographic keys
required
Spam Reduction
• Spam reduction
• Before accepting email, receiver requires proof
that sender spent effort to create email
– Here, effort == CPU cycles
• Goal is to limit the amount of email that can be
sent
– This approach will not eliminate spam
– Instead, make spam more costly to send
Spam Reduction
• Let M = email message
R = value to be determined
T = current time
• Sender must find R so that
h(M,R,T) = (00…0,X), where
N initial bits of hash value are all zero
• Sender then sends (M,R,T)
• Recipient accepts email, provided that…
h(M,R,T) begins with N zeros
Spam Reduction
• Sender: h(M,R,T) begins with N zeros
• Recipient: verify that h(M,R,T) begins with N zeros
• Work for sender: about 2N hashes
• Work for recipient: always 1 hash
• Sender’s work increases exponentially in N
• Small work for recipient regardless of N
• Choose N so that…
– Work acceptable for normal email users
– Work is too high for spammers
Secret Sharing
Shamir’s Secret Sharing
Two points determine a line
Y
Give (X0,Y0) to Alice