How do I create an encrypted (password protected) zip file?
This will prompt for a password:
zip --encrypt file.zip files
This is more insecure, as the password is entered/shown as plain text:
zip --password (password) file.zip files
Warning, the standard zip encryption is very weak and is easily cracked.
You can also right-click on a folder or file(s) in Nautilus and select "Compress...". In the resulting window, you can expand the "Other Options" section to enter a password.
If the password field or any of the other options are not enabled, then the selected compression option does not support it. Select a different one from the list after the filename. According to the documentation:
Currently, only 7-Zip, ZIP, RAR and ARJ archives support encryption
Starting from Ubuntu 17.10, right-clicking and selecting "Compress" no longer has "Other Options" listed.
To resolve this, open "Archive Manager" and then drag & drop the files/folders from your File Manager into it and it will appear.
sudo apt-get install zip zip -r --encrypt result.zip folder
- Install zip
-rto zip directory and subdirectory
--encryptto secure your files
with a simple password-based symmetric encryption system, which is documented in the ZIP specification