In order to encrypt a file you should provide also the file
I/O
operations. That is you have to:
- Read the input file into a memory buffer.
- Encrypt the memory buffer.
- Write the encrypted memory buffer to the output file.
Steps (1)
and (3)
are only required for encrypting a file.