I am wanting to securely wipe a file - of any type or format - obviously the File.Delete
command in C# is no where near safe enough.
I seem to recall a post here (I can't find it again though!) that explained the modern File Systems (i.e newer than FAT32) can cause issues when attempting this kind of delete as they're a journaling file system and recovering data is far easier than in ye olden days.
After even more reading, I read it would be an idea to:
- Generate a random 256 bit encryption key.
- Encrypt FileA to FileB.
- Generate a new random 256 bit encryption key.
- Encrypt FileB to FileA.
- Repeat this n number of times to suit your level of paranoia.
- Use File.Delete to delete FileA and FileB.
This seems a logical way for encrypting/re-encrypting the data in the files over and over with keys that will never ever be recoverable or re-usable but is this actually a secure way? Will the file system overwrite the file at the same location/cluster (obviously the file will grow as it's contents are subject to encryption/re-encryption), ensuring the original content is overwritten?