1

I have to generate a signature for concatenation of multiple independent values say A | B | C. Two options are :

  1. concatenate all attributes and generate the hash. Then Sign hash.

$$ signature = Sign\big(Hash(A\mathbin\| B \mathbin\| C)\big)$$

  1. Use hash of previous value along with current value to generate the hash. Sign the generated hash.

$$ signature = Sign\big(Hash\big(Hash\big(Hash(A)\mathbin\| B) \mathbin\| C)\big)\big)\big)$$

Analogous to taking two hashes of a value, option 2 seems cryptographically strong. Kindly help in picking right practice and why?

kelalaka
  • 49,797
  • 12
  • 123
  • 211
Genie
  • 83
  • 6

0 Answers0