Where to store the file extension to retrieve it correctly after decryption
If you are encrypting one file to one file, simply save the correct extension. Example: open test.pdf, encrypt the content, and save as test1.pdf, or test1.pdf.enc (so that you know that the file is encrypted and any pdf won't try to open it when you double click).

If you are encrypting more than one file together (and, in the end, you have one big chunk of data that contains more than one file inside), you're already having to deal with "which byte belongs to which file", and then storing the original filename is just part of this file manipulation.