Create a password-protected zip on Mac
Encrypt a folder or files into a password-protected archive from Terminal.
01Command
$ zip -er ~/Desktop/secret-archive.zip ~/Documents/ProjectFolder02What it does
The built-in zip supports classic password encryption: -e prompts for the password, -r includes folder contents recursively (plain zip -e secret.zip file.pdf works for single files). The recipient unzips with Finder or unzip archive.zip and enters the same password. The archive name goes before the files to archive. For stronger AES-256 encryption and filename hiding, use 7z from Homebrew (7z a -p archive.7z folder), since zip's legacy ZipCrypto is weak.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- macOS zip command referenceEvidence: zip -e prompts for a password to encrypt the archive; -r recurses into folders.
Last verified: 2026-09-16 · Category: Security & Privacy
06Related solutions
Point macOS screen captures at any folder you choose instead of the desktop.
Grab any file from the web straight into the current folder — no browser needed.
List the biggest files in your home folder that are eating disk space.