Quote Originally Posted by katy_price View Post
so it reads, encrypts/ decrypts data in the input file and copies data 512 bytes at a time to the output file, when the data is less than the buffersize thats essentially the last read and copy right?
Right.

Note that the read operation in the copy-and-en/decrypt loop is done on the crypto stream that is "stacked on top" of the input file stream. The crypto stream then does read operations as needed on the input file stream itself. Not sure whether that was what you meant in your sentence I quoted.