Lonnie Risckle
Posts: 21
Joined: Mon Feb 17, 2014 12:48 pm

Secure reformat of memory cards

Wed Feb 14, 2018 8:30 pm

When you reformat magnetic media 'securely' you write random data across the entire surface, because iron remembers previous magnetisation, leaving slight variations in the magnetisation of the new data, and sufficiently sensitive equipment can decide what was on the medium before the current write.

Indeed, I remember reading in the 1980s that a lab had managed to track more than seven previous writes. I was working for a defence contractor, where there was a storage room full of dismountable disks that had had classified information stored on them, and they were classified 'Top Secret' for eternity.

My question is, do USB sticks and SD cards also have a memory of previous contents? Am I wasting time doing more than one write of the volume?

User avatar
rpdom
Posts: 12949
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: Secure reformat of memory cards

Wed Feb 14, 2018 8:43 pm

Lonnie Risckle wrote:
Wed Feb 14, 2018 8:30 pm
My question is, do USB sticks and SD cards also have a memory of previous contents? Am I wasting time doing more than one write of the volume?
No. They are made up of cells that can only store a 1 or a 0. The magnetic disk thing is because it is magnetising a small area and the whole area doesn't always get changed and with the right equipment it is sometimes possible to read some of the field around the edge of the main area.

User avatar
rpdom
Posts: 12949
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: Secure reformat of memory cards

Wed Feb 14, 2018 8:48 pm

rpdom wrote:
Wed Feb 14, 2018 8:43 pm
Lonnie Risckle wrote:
Wed Feb 14, 2018 8:30 pm
My question is, do USB sticks and SD cards also have a memory of previous contents? Am I wasting time doing more than one write of the volume?
No. They are made up of cells that can only store a 1 or a 0. The magnetic disk thing is because it is magnetising a small area and the whole area doesn't always get changed and with the right equipment it is sometimes possible to read some of the field around the edge of the main area.
Actually, that isn't strictly true, as flash memory uses various wear-levelling techniques which mean that overwriting some data may mean that the new data gets written to a new part of the chip and the old part is marked as unused even if it isn't overwritten. It will still need very special equipment to read it. If you are really worried about data security then a big hammer will work or a blow torch.

User avatar
Imperf3kt
Posts: 1481
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Secure reformat of memory cards

Wed Feb 14, 2018 8:51 pm

SD cards are based on NAND flash
https://en.wikipedia.org/wiki/NAND_gate

I'm not positive, but I believe these are digital 'True' or 'False' and don't operate on magnetics.
Though, I'm no expert.
Stop plugging your fan directly into the GPIO 5v
https://www.electronics-tutorials.ws/power/transient-suppression.html

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Secure reformat of memory cards

Wed Feb 14, 2018 9:35 pm

The only way to achieve total data elimination is by physical destruction which means incineration in the case of any flash memory device.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

W. H. Heydt
Posts: 9240
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Secure reformat of memory cards

Thu Feb 15, 2018 5:46 am

I know of one company that decided HDDs were sufficiently securely erased by laying them out in the yard and bringing over a crane with a 50-ton electromagnetic crane, lowering the hook over the drives and turning it on. Of course, the way to be really sure in the melt them down...

Heater
Posts: 10284
Joined: Tue Jul 17, 2012 3:02 pm

Re: Secure reformat of memory cards

Thu Feb 15, 2018 7:42 am

The main reason for writing over all blocks on a storage devices is that when you do a normal format most of the data is not actually erased or overwritten. All that happens is that the OS initializes the disk format data structures. The allocation tables, directory pointers and so on. A block that is no longer pointed to by a link in some disk format structure is effectively "gone" as far as the OS is concerned, although the data content of that block is still there physically.

The next concern is that disks, SD cards etc tend to keep hidden blocks that they may swap in in case of failure or for the purposes of wear leveling. Those blocks that you cannot access may well end up holding your secrets. As you may guess, writing random junk over the blocks you can access does not remove data from those hidden blocks.

I have heard this heard this tale of "some lab" recovering data from disk blocks that have been written over multiple times before over the years. I'm coming to the conclusion that it's a myth. I have yet to find any links to papers or other evidence that confirms it.

Anyway, for the paranoid, Dougie is right. Physical destruction is the only way to be sure your secrets are gone. Mostly because of those hidden blocks I mention. And who knows in what other ways the controllers in the devices lie to you?

Return to “Off topic discussion”