
Let us know what other ways you use compression and password protection of your files on macOS in the comments. This compression and password protection is agnostic to the desktop operating system so you can send it to Window users, Linux users and of course Mac users. The file will be uncompressed into the same directory.You can test the protection by double clicking the file.
MAC OS PASSWORD PROTECT ZIP COMMAND LINE ZIP FILE
MAC OS PASSWORD PROTECT ZIP COMMAND LINE ARCHIVE
Zip sample.zip mydocument.txt The Terminal will create and place the ZIP archive in your current folder. In the command below, sample.zip is the name of the output ZIP and mydocument.txt is the file to be added to the ZIP. Now type in the command that will simultaneously compress and password protect the files in the form of zip -er FILENAME.zip FILESorFOLDERStoCOMPRESS. The best and easy way to encrypt any file is to password protect it by making a zip archive on MacOS.Type in ls to make certain you see your folder.For example, in my instance that would be to type cd /Volumes/dataMAC and hit enter. Change your directory to the location of your folder.Since Finder doesn't have a native password protection option, we'll have to go deeper under the skin of macOS and straight up a terminal window. You'll need another method to transfer your files such as via Dropbox. Secondly, some companies disallow the reception of compressed files via e-mail due to people unknowingly opening malware and as such, your attachment may get stripped and the e-mail server. To decompress password-protected ZIP archive files on a Mac, just double-click them and supply the correct password when prompted. Note that if you are e-mailing files, most e-mail providers have a limit on attachment sizes.

Once you have your files in the generated folder, you can now go on to the business of compressing and password protecting the files. Drag and drop your sensitive files into the new folder.Rename the folder, preferably something without spaces as this will make terminal commands simpler for you.

Option-click the Finder window and create a New Folder. So if you have multiple files for compressing and protecting, you can organize them into a single folder using Finder. Since we'll be using the terminal application that is native on macOS, you'll want to make the compression of your files as simple as possible to avoid long strings of commands. If there was ever a time to vigilant with securing your private data, this would the moment! Here's how you can create a compressed zip file with your sensitive data and password protect it on natively macOS. Tax time is here and many of us will be sharing sensitive information from our financial institutions with our accountants.
