Create a password-protected zip file

Zip files with a password so only the recipient can open them.

LinuxZip & ArchivesencryptionMedium risk
Run zip -e archive.zip file1 file2 and enter a password when prompted; extract later with unzip archive.zip.

01Command

Command
$ zip -e secret.zip report.pdf photos/ && unzip secret.zip

02What it does

zip -e encrypts the archive: it asks for the password twice, and anyone extracting with unzip, 7z, or a GUI archiver must enter it. Standard zip encryption is old and weak — fine for casual sharing, not for truly sensitive data. For strong encryption use 7z with its -p option or gpg.

03Risk

RiskMedium risk
!Warning: Traditional zip crypto can be cracked quickly by modern tools. Don't rely on it for bank statements or credentials; use 7z -p (AES-256) or GPG instead, and never send the password in the same message as the file.

04Undo

Undo
$ unzip secret.zip (keeps original files; delete the archive to undo)

05Sources

Last verified: 2026-09-18 · Category: Files & Folders

06Related solutions