Nov 10, 2018

How to Create a Password Protected ZIP File in Linux

Warning! The standard ZIP encryption is very weak and could be cracked easily.

Interactively:

$ zip --encrypt encrypted.zip file1 file2 file3
Enter password: 

Verify password: 

for a directory:

$ zip --encrypt -r encrypted.zip /var/backup/
Enter password: 

Verify password: 

Non-interactively:

$ zip -P passw0rd encrypted.zip file1 file2 file3

Warning! The password is plain text and can be logged in history file.