Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Securely delete a file 1

Status
Not open for further replies.

csutton

Programmer
Joined
Dec 27, 2000
Messages
213
Location
US
In my program, I have to create an encrypted file from a plain text file. My question is: Is there a way of SECURELY deleting the original plain text file so that it is difficult ( I know it isn't impossible) to recover this file?

Thank you.
 
Open the file in binary mode, and overwrite it 5 times with random data prior to deleting it. Get the random data from the RNGCryptoServiceProvider class in System.Security, not the VB built-in method Random()

Note that this overwrite method won't work on flash drives because of the way they rotate write locations.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top