
Plus we want to let this data accessible only by the authorized person.īut when it comes to password protect zip files, usually you have to rely on third-party software. We do not want anyone else to access the data in these confidential files. Many times there comes a situation when we have to create a zip archive with confidential files. The zip -P uses standard encryption.If you want to compress the zip files and password protect them without using third-party utility in Mac, then this article is for you. This seems safer as it prompts you for your password (instead of typing it directly as an argument to zip -P, but uses weak PKZip 2.0 encryption.

Note: this article used to refer to the zip -e command. The first argument after that is the name of your new, password protected, zip file and the second argument is the file or folder you want to encrypt.

The zip -P will be followed by the password for your ZIP file. Note if you type the zip command in your shell with an extra space before the command, it won’t be saved in your bash history! Since you’re typing the password directly as a command-line argument, it poses a security risk of staying in your history files. $ zip -P YourPass my_zip_file.zip your_original_file.docxĪdding: your_original_file.docx (stored 23%) Go to your directory where you have the files/folders you want to zip: cd ~/Desktop/files/.

To do so on a Mac, follow these steps (which should be easy if you’re familiar with the command line). It’s not 100% safe, it can still be brute forced and you probably shouldn’t be sending your banking details like this, but it can be useful to send along information this way. If you want to send someone a file of which the content you prefer to remain anonymous, you can send it in a password protected ZIP file.
