i think that if you have a huge input file, it will take time whatever method you use. There is no table-of-contents idea, so there is no way to know what the expected size will be. Perhaps you could consider a different approach:-
- Get the file name & size of the plain file before encryption
- Get a checksum of the file after encryption and link to the above
When you need the information, you can get the values from wherever you stored it a validate that the encrypted file is the same one by generating the current checksum.
It will still read the file to generate the checksum when you want to validate it, but it does not need to do decryption processing, so that might save a bit.
Basically though, large files will take time.......
Robin