Although the zip and zipcloak programs on Linux can produce encrypted zip files, there are some significant and intriguing distinctions between the two. Here’s everything you need to learn about how they operate and how to use them.
zip
The zip command provides a simple method for combining the contents of multiple files into a single compact file. Use a command like the one below to combine multiple files into one (usually done for easy copying to other systems). The name of the zip file to use is the first argument and then the list of files to include.
The following command is a simple example of merging files into an encrypted ZIP file. Note that the -e option specifies that the resulting ZIP file must be encrypted. The command will fail if you don’t enter the same password at each prompt.
The zip command not only keeps the files together but also reduces the size of the file being processed. These sample ZIP files are less than half the size of the two files combined. Note the “deflated” line in the output above.
The original files can be deleted after being added to the encrypted ZIP file, but the password used must be maintained so that the contents can be extracted later.
You can also use the zip command to collect files recursively and include them in a ZIP file. Here is an example command that puts all the files in the bin directory into a file called “bin.zip”.