Is random data compressable? #162
PartialVolume
started this conversation in
General
Replies: 1 comment
-
Even tried lz4 at max compression
It still produced a file larger than the original random data.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So one of Blanco's patented methods for wiping SSD's is to wipe the drive with compressed data. I believe the thinking behind this is that if the drive were compressing the data itself then you wouldn't be able to write to all the cells unless you gave it something that the drive itself was incapable of compressing any further. However the patent goes to to describe the compressed data as prng data. So really they are talking about using a PRNG to write to SSDs as random data can not be compressed. How does this form the basis of a patent? Wiping storage mediums with a PRNG has been around for ever.
But isn't random data already hard to compress? i.e it's not like it's all zero's one's or some repeating pattern that can be easily compressed to a fraction of it's original size.
So I thought I'd do a very quick check. Setup a loop device of 1MByte in size. Then
sudo ./nwipe --method=prng --prng=twister --noblank --verify=off /dev/loop31
to fill it full of random data.Then transfer it to a file
sudo dd if=/dev/loop31 of=random_data
I then compressed it using KDE's Dolphin menus to produce a random_data.tar.gz file. Guess what the outcome was ..
The compressed file was bigger than the original !, ok so it was a random data file wrapped in a tar then compressed. What if I just gzipped the original file without the tar.
-rw-r--r-- 1 root root 1048576 Jul 28 00:31 random_data
-rw-r--r-- 1 nick nick 1048777 Jul 28 00:31 random_data_compressed.gz
-rw-rw-r-- 1 nick nick 1049101 Jul 28 00:32 random_data_compressed.tar.gz
-rw-r--r-- 1 nick nick 1048783 Jul 28 00:57 random_data_max-9_compressed.gz
``
Nope, the compressed file is still larger than the original.
So what's the conclusion? Could there be better programs for compressing random data? Is blanco's method of writing compressed data exaggerated or just marketing hype? Can you compress 1Mbyte of mersenne twister random data below it's original size? Am I missing something here? Is gz not working or is it extremely hard to compress random data? Or is writing a prng random stream to a SSD much the same thing as writing compressed data to a SSD.
Yes, it's not a good idea to keep wiping your SSD using the traditional block write as opposed to it's own build-in secure erase feature but for the purposes of this discussion you don't care about longevity of the drive, you just want the data gone.
Beta Was this translation helpful? Give feedback.
All reactions