Submitted by [deleted] t3_ydcv2u in explainlikeimfive
philipjfry1578 t1_itrdtet wrote
Reply to comment by enderverse87 in ELI5: How do the people who make zip bombs compress it down so much? by [deleted]
So it's not possible to compress an already made file this small?
RhynoD t1_itreqyh wrote
It's not possible for an already made file like that to exist. Unzipped zip bombs can be many thousands of petabytes, which are themselves a thousand terabytes each. Most computers have a few terabytes of storage at most (which is the point of the zip bomb) and even if they did, unzipping files that big would potentially take years (also the point of the zip bomb).
If you started with an actual file to compress it would take up that much space and take that long to compress. You'd zip bomb yourself.
Partnumber t1_itrfukf wrote
At a very basic level, compression just takes the existing data and finds a shorter way of writing it. Let's say I had a list like:
Apple
Apple
Apple
Banana
I could compress the list, rewriting it as
3 Apple
1 Banana
And the same amount of data takes up less space. But it still takes up some amount of space. And the amount of space it takes up is directly related to the format of the list.
Apple
Apple
Banana
Apple
For instance would have to be compressed into
2 Apple
1 Banana
1 Apple
Which takes up more space, even compressed. So any meaningful data you have has a lower limit on how small it can be and still be useful. A zip bomb would be like sitting down and maliciously making a list that, when compressed, says
99999 Apple
The compression is very small but the output is very large.
TLDR: You can construct a file that compresses into a miniscule file size, but most real files that contain usable information won't.
enderverse87 t1_itreu8p wrote
Only if it's something simple, like you could compress an incredibly large blank white image down really tiny. And then you could edit the zip file to say there's actually a million of them in there.
But for the most part that's not going to work as well.
Viewing a single comment thread. View all comments