When thinking of encrypting a file (also how I implemented it in a program of mine), I think of getting the data of a file, encrypting it, and writing it back into the file (overwriting the file).
But actually, is that the usual way of encrypting a file?
Since when securely deleting files, there is also the option to overwrite the data at the memory address of the file multiple times.