How to create minimum size (empty) zip file, which has 22B? How to create minimum size (empty) zip file, which has 22B? linux linux

How to create minimum size (empty) zip file, which has 22B?


Here you go:

50 4b 05 06 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00

That has the MD5 signature you provided.

If you have Info-ZIP's zip, you can create it thusly:

zip empty.zip anyfilezip -d empty.zip anyfile

That adds "anyfile" to a new zip file, and then deletes it from the zip file, leaving it empty.


An easier-to-use version for copying-and-pasting into the shell:

echo UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA== | base64 -d > empty.zip

This just prints the base64'd version of the empty zip file (created by creating a zip file with a single file then deleting that single file from the zip file), and reverse the encoding with base64 -d and writes the output to empty.zip.


If the version of base64 that ships with your machine doesn't use the same syntax as above, here's a more-portable but less-terse alternative:

echo UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA==  | openssl enc -d -base64 > empty.zip


with this .bat script you can create empty.zip file under windows:

@echo offdel /q /f empty.zip >nul 2>nulcertutil -decode "%~f0" empty.zip-----BEGIN CERTIFICATE-----UEsFBgAAAAAAAAAAAAAAAAAAAAAAAA==-----END CERTIFICATE-----