Hello guys of crypto stack.
I am working on a project to hash data blocks, and i have a question that maybe someone here can clarify me. Its about hash functions:
Let’s say I have a data package, Data, and over it I apply a hash function (for instance sha256), resulting in X:
X = sha256(Data)
Now suppose I break this data package into N pieces, Data1, Data2, Data3... DataN, and apply the same hash function to each piece; I will have:
h1 = sha256(Data1)
h2 = sha256(Data2)
h3 = sha256(Data3)
...
hN = sha256(DataN)
For last, let’s say I apply the same hash function over the hashes h1, h2, h3... hN concatenated, obtaining Y:
Y = sha256(h1, h2, h3,..., hN)
Considering that the entire data package was processed by the sha256 function in obtaining both X and Y:
From a cryptographic process perspective, is Y as secure as X?.
If it is not, why?
Thanks in advance.