|
|
|
|
|
by ginkgo
5556 days ago
|
|
How could a program work that can detect such scam-drives? As long as we don't care about crashing the formatting, at least. It could work by writing a specific pattern in the first few bytes of the device and then reading/writing in 2^n steps to check if the pattern cycles. I think I have some counterfeit thumb-drives lying around. Maybe I will try writing something like that.. |
|
Using this approach, you can write arbitrarily large of data to a drive with very minimal storage requirements on your end (well within even modern-day embedded RAM availability), while still being able to demand any sector back at any moment and verifying it is correct. Theoretically your psuedorandom number generator ought to by cryptographically secure, and given that you're probably IO bound here and they aren't hard to come by, there's probably no reason to use anything less.
I'm pretty sure the only effective defense against that is to actually store all the data. If you issue a predictable read pattern, you open an attack. If linearly-sampling your previously written blocks turns out to be undesirable you could tweak the sampling distribution, but I bet you wouldn't get much improvement.
Also, come to think of it, if the drive is honest this could be done non-destructively (assuming the undo process is allowed to run to completion) by reading the sector and XOR'ing it, so you could then undo it by a second XOR operation. Further cleverness could even make this reasonably safe to half-complete the undo, then finish later, if you work at it.