I have a requirement where an encrypted file is read in random order of 32k chunks and decrypted and final content hash is computed. This hash should match the original content of file.
I need this as while I am reading file from source I want decryption and hash computation to happen, else I will have to write all the contents and then decrypt and compute hash, which will require two pass/(read/write) of file.
I believe AES stream mode would help in random order decryption, I have to try this though, but I am not sure about which hash function would help here, if its possible to compute any hash reading data in random chunks.
Any pointers would be of great help. Thanks for time.