Password-Protect a Zip Archive

Create an encrypted zip with zip -e so only people with the password can open it.

macOSZip & ArchivespasswordencryptionLow risk
Run `zip -e secret.zip ~/Documents/report.pdf` and enter a password when prompted.

01Command

Command
$ zip -e secret.zip ~/Documents/report.pdf

02What it does

macOS's built-in zip supports password encryption: -e prompts for a password and every file in the archive is encrypted. This is the quick way to safely email a scan, tax document, or private photo album — send the archive and the password through different channels. Recipients can extract it with the built-in Archive Utility.

03Risk

RiskLow risk
!Warning: Zip's traditional encryption is weak by modern standards; for highly sensitive data prefer an encrypted disk image (hdiutil) or AES-256 zips made with third-party tools.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions