This looks useful. However, the encryption would not be done in-place anyway (otherwise, if the app was terminated in the middle of encrypting a file, we would end up with half-encrypted file). That means that we would still have to do File.Delete(filename)
+File.Move(encrypted, filename)
afterwards (sadly, Windows doesn't support POSIX-like atomic rename).
We will consider this, but implanting a custom extension method for the FileEncryption
class is the recommended solution for now.