3 ms·
You could do that, but doesn't it seem easier to: 1) initialize a CSPRNG to a known seed; 2) generate random numbers and write them sequentially; 3) initialize
by mort96 4y ago
You could do that, but doesn't it seem easier to: 1) initialize a CSPRNG to a known seed; 2) generate random numbers and write them sequentially; 3) initialize a new RNG to the same seed and compare numbers you generate to numbers you read from the storage? That way, you even get to point at the exact byte where the first divergence happens, which might let you say, "this drive which claims to be 30TB seems to be 1GB".
- pronoiac 4y agoI think that would avoid the potential loophole I was worried about! I'd be careful with the periodicity of the RNG though. I was on a machine with limited user space. I used OpenSSL, no new binaries, reading and writing at close-to-wire speeds. "Counting zeroes" would track down where they don't match, doesn't it?
- NavinF 4y agoCSPRNGs don’t have that issue.
- ThatPlayer 4y agoOnce you find the exact byte where you know the storage ends, you can actually format the drive it's completely usable. F3 can do this with f3probe and f3fix. https://fight-flash-fraud.readthedocs.io/en/latest/usage.html#how-to-fix-a-fake-drive https://fight-flash-fraud.readthedocs.io/en/latest/usage.htm... I've used it on a 2GB microSD that came with a 3d printer that turned out to be 100MB. I continued to use it to transport files to my 3d printer for a bit with this.