Consider the following pattern:
const int defaultBufferSize = 4096;
var stream = new FileStream(
Path.GetTempFileName(),
FileMode.Create, FileAccess.ReadWrite, FileShare.None,
defaultBufferSize,
FileOptions.DeleteOnClose);
Does the runtime or any operating system guarantee that created temporary file can never be accessed from an external unprivileged process? If so, does that fact make it pointless to manually encrypt the file?