Secure file erase
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
For general use, probably yeah. Testing against popular recovery software might be worth considering too.
When it comes to specialized hardware recovery it's a different story,
as said in the posts above all they need to do is read the data that is there (i.e all 0's or maybe some other file stored tin that location).
They read that normally, then they read again but filtering out the known data, what they see now is either fragments of older data or the previous data.
Commercial facilities (that rescues burned or damage drives and their content) are able to filter down through the magnetic residue.
Remember old cassette or VHS tapes? Remember how when you had re-recorder over them many times the image gets really bad or the sound really muddy?
That is magnetic residue from previous recordings mixed in with the new recording that you hear/see.
HD's and Floppy's use the same way to store data as tapes.
Rewritable CD's and DVD's are probably less prone to this though, although I suspect that it's possible with proper laser calibration and equipment to retrieve parts of what was overwritten.
Ditto for ram as mentioned, and thus SSD's are probably subject to similar possibilities.
The only solution to truly safely destroy data is to store it on disposable media and destroy that when you are done with it.
But as I said earlier, encryption is a nice advantage.
Even if the data can be retried if it has been overwritten, as long as they can not understand what it is they can't use it. Unless you are forced to disclose how/what encryption/which password was used to encrypt the data you deleted/erased.
so if the data is so sensitive, make sure that you never stored it on disk in plaintext to begin with, make sure it's always stored in encrypted form, only decrypt in memory etc.) There are WinAPI's that ensures that the memory you use is actually in memory and not in the page file etc. Especially for use with encryption.
When it comes to specialized hardware recovery it's a different story,
as said in the posts above all they need to do is read the data that is there (i.e all 0's or maybe some other file stored tin that location).
They read that normally, then they read again but filtering out the known data, what they see now is either fragments of older data or the previous data.
Commercial facilities (that rescues burned or damage drives and their content) are able to filter down through the magnetic residue.
Remember old cassette or VHS tapes? Remember how when you had re-recorder over them many times the image gets really bad or the sound really muddy?
That is magnetic residue from previous recordings mixed in with the new recording that you hear/see.
HD's and Floppy's use the same way to store data as tapes.
Rewritable CD's and DVD's are probably less prone to this though, although I suspect that it's possible with proper laser calibration and equipment to retrieve parts of what was overwritten.
Ditto for ram as mentioned, and thus SSD's are probably subject to similar possibilities.
The only solution to truly safely destroy data is to store it on disposable media and destroy that when you are done with it.
But as I said earlier, encryption is a nice advantage.
Even if the data can be retried if it has been overwritten, as long as they can not understand what it is they can't use it. Unless you are forced to disclose how/what encryption/which password was used to encrypt the data you deleted/erased.
so if the data is so sensitive, make sure that you never stored it on disk in plaintext to begin with, make sure it's always stored in encrypted form, only decrypt in memory etc.) There are WinAPI's that ensures that the memory you use is actually in memory and not in the page file etc. Especially for use with encryption.
SSD's are worse for security in their current infancy. If the power is removed while an SSD is writing, in some cases, complete latent images can be left in locked areas which you will not be able to access at all to remove. If the SSD contains sensitive material the only hope to ensure the material is destroyed is to destroy the drive. If anyone is considering an SSD for sensitive work that needs to stay sensitive you need to make sure that you have a UPS on the system so that power can remain applied in the event of a power outage to let you shut down properly. I'd wait a few more years before i'd move to SSD's if your doing sensitive work so the technology has a little more time to mature.Rescator wrote: Ditto for ram as mentioned, and thus SSD's are probably subject to similar possibilities.
The only solution to truly safely destroy data is to store it on disposable media and destroy that when you are done with it.
Last edited by SFSxOI on Tue Aug 18, 2009 10:24 pm, edited 1 time in total.
The problem on SSD's is not the power. It's that the location of a write is not the location of the original data. SSD-Chips are full of old data. And there is no reliable way to delete it. Maybe the internal controller will get a function for save deleting in the future. But overwriting it, does not work, because you are actualy not overwriting the data. It will be written to another chip.SFSxOI wrote: I'd wait a few more yesr before i'd move to SSD's if your doing sensitive work so the technology has a little more time to mature.
It's called: wear levelling
Its a good question, a fair question. One simple answer is encryption doesn't secure sensitive data. WHAT! thats right, encryption alone doesn't secure sensitive data. All encryption does is keep prying eyes away for short periods of time, but the data is no more secure then without encryption. The important elements needed to back up encryption are controlling access to the data in the very first place, ensuring the integrity of the system or transport method used, and ensuring the truthworthiness of the people that acces it, and protecting the data asset.Trond wrote:If it is sensitive data, why is stored on the disk without encryption anyways?
There are four levels of security, the four D's we un-officially call them in the Information Security field, these are detect - deny - deter - defend. In all of those, encryption is one of the weakest links and can't really help secure sensitive data unless all four are in place. So simply encrypting data on a disk and leaving it at that really doesn't matter.
Encryption is encryption is encryption, oh yeah, there is encryption in different flavors...thats about it.Rescator wrote:Good points both Trond and SFSxOI.
Hmm. where does (hardware) encryption drives fall into all this?
You know, those drives that encrypts at some point during the transmission to the disk.
A better method of encryption is to encrypt at the moment of creation so that as it enters the transport mechanism its encrypted with one key and then encrypted again in the transport mechanism with a different key, and then re-encrypted yet again with another different key as its sent to the drive. And so on and so forth. This type of encryption scheme is difficult and expensive to implement and is generally not available to mere mortal humans, being in the rhelm of the likes of the National Security Agency (NSA), or CIA, or FBI, or DoD, or other governments similar functions. Although the number of transport points has increased so has the number of keys which mitigates the weaknesses of the transport points so that at any point in the transport multiple keys are needed and the likley hood of having all the keys needed at any transport point decreases for an adversary. Even this system needs to be backed up by the four D's., which is why in most secure systems the drives are removed at the end of the work day and secured in a vault or safe in a secured area.
All this is still just dealing with the computer its self, wait until you get to the network or internet part as you ain't seen nothing yet and the encryption used at the computer just for the data its self becomes useless. Although the basics still apply, in the network or internet (which is just one big network basically) its a whole new ball game.
Last edited by SFSxOI on Wed Aug 19, 2009 5:39 pm, edited 2 times in total.
Mind you, some "hardware encryption" enabled devices actually don't encrypt a thing. It's what you understand under encryption. Some devices apply binary data obfuscation with a salt and decrypt the obfuscated data with the hardware stored salt key on the fly (very expensive and resource consuming) while others simply use a simple password authentication in hardware level to allow or disallow access to stored data (extremely inexpensive yet not safe enough).
Just a suggestion.netmaestro wrote:Would this code wipe a file safely? Can I be sure the written bytes are going exactly where the existing bytes are? Help is appreciated.Code: Select all
If OpenFile(0, filename$) For i = 1 To 7 FileSeek(0,0) For j= 1 To Lof(0) WriteByte(0,0) Next Next CloseFile(0) DeleteFile(filename$) EndIf
I think that is better to close and reopen the file in every pass, to commit any temporary buffer to disk.
After all passes delete the file and create a new file with the same file name and delete again the new file.
Code: Select all
For i = 1 To 7
If OpenFile(0, filename$)
FileSeek(0,0)
For j= 1 To Lof(0)
WriteByte(0,0)
Next
CloseFile(0)
Endif
Next
DeleteFile(filename$)
Createfile(0, filename$)
WriteByte(0,0)
CloseFile(0)
DeleteFile(filename$)
» myPersonal Banker :: Because you do not need to have a master degree in economics in order to organize your finances!
- utopiomania
- Addict

- Posts: 1655
- Joined: Tue May 10, 2005 10:00 pm
- Location: Norway

