This question is related to this (but it is not the same).
Let's suppose I have a seed with an entropy of 1024-bits and hash it with a counter using a hash function with one-quarter of the seed size in bits as BLAKE2s (256-bits digest size).
I hash the seed with counters and XOR the result to plaintext.
As said in this answer, some options are (the third I proposed by myself):
- H(00∥F) ∥ H(01∥F) ∥ H(02∥F) ∥ H(03∥F)...
- H(H(F)∥00) ∥ H(H(F)∥01) ∥ H(H(F)∥02) ∥ H(H(F)∥03)...
- H(00∥H(F)) ∥ H(01∥H(F)) ∥ H(02∥H(F)) ∥ H(03∥H(F))...
/\ H is the hash, F is the file and 00, 01, 02, 03 the counters.
PS: For H(F∥00)∥H(F∥01)∥H(F∥02)∥H(F∥03), it was answered here.
Assuming that the hash function is not vulnerable to length-extension attacks and not caring about optimizations, what of these it is the most secure scheme in practice? And why?