How to password protect zips on Mac ๐Ÿ”‘


Protecting our files is essential, how to password lock a zip on Mac?

29 Sep, 2020 ยท 1 min read

If you're on Windows, you might think, but why? Well, Mac doesn't offer a GUI interface for password protecting zips.

Yes, bizarre, right?

We can right-click a file/folder and compress it into a zip.

But we can, by using our best friend The Terminal password, protect our zip files!

Mac default zip function

Using terminal to password protect zip files on Mac

So let's open our favourite terminal program (mine is iTerm2) and enter the following command.

zip -er ~/Desktop/ ~/Desktop/secure.csv

The parameters are as follows:

  • zip - The actual zip command
  • -er - Encrypt Recursive
  • ~/Desktop/ - Output zip name
  • ~/Desktop/secure.csv - Input file/folder

Once we run this, we get prompted to type a password.

You don't see any input on these password fields!

Press enter, and you need to verify the password.

Secure-zip on Mac

We now created a secure zip.

If we try to open this zip, we see the following prompt.

Zip with password on Mac

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Spread the knowledge with fellow developers on Twitter
Tweet this tip
Powered by Webmentions - Learn more

Read next ๐Ÿ“–

May the 4th be with you

4 May, 2022 ยท 2 min read

May the 4th be with you

Which articles are you missing?

20 Apr, 2022 ยท 2 min read

Which articles are you missing?

Join 1372 devs and subscribe to my newsletter