0

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.

4
  • Overwriting is a good option but useless on SSDs (flash based media).
    – Robert
    Nov 28 '21 at 20:33
  • You need to make sure it actually overwrites the original blocks, rather than writing the new (encrypted) version in a different place. This'll depend on both the filesystem (copy-on-write filesystems always write the new contents in a different place) and physical storage (flash storage uses copy-on-write at the physical layer). Nov 28 '21 at 20:48
  • so on windows, with a HDD, overwriting the file is fine? While on windows with an ssd, is not?
    – Dahlin
    Nov 28 '21 at 20:54
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Nov 29 '21 at 2:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.