Table of Contents
Often, we compress or zip files on Mac to save space, but we should pay attention to what we store. You may be compressing files that contain sensitive information. ZIP files are great for making it harder to access the data they contain, but this compression doesn’t prevent prying eyes from taking a look at it.
In this article, we will show you how to password protect a ZIP file, how to open encrypted ZIP files and folders, and we will introduce you to some best practices for protecting your data.
1. Using Terminal to password protect a ZIP file
You can zip folders and files relatively quickly via Terminal and protect them with a password. You need to know some commands for this, but then the process is fairly straightforward. Here’s how it works:
- Open Terminal on your Mac
- Type “cd” (without parentheses) and the location of the file or
folder that you want to compress and protectNote: If your file or folder were stored on the desktop, you would type: cd desktop
- Type this command into the terminal: zip -er filename.zip
Note: In the image below our folder is called “Setapp”, so the command is: zip -er setapp.zip
- Enter and confirm a password
That’s it! You will now see a compressed file on your desktop. When you double-click the file or folder to open it, you will be asked for the password you entered in Terminal.
Are there alternatives?
The terminal is great for compressing and encrypting a file or folder, but it’s not suitable for multiple compressions. You can enter multiple file or folder names after the ‘zip -er‘ command, but an accidental keystroke or an incorrectly entered file name will render the whole process useless.
Therefore, a program that handles compression and encryption is the better choice for most users – especially if there is a simple drag-and-drop feature or your entire file system is displayed in one window.
2. Using BetterZip
BetterZip for Mac is – well, better! The app has a clean, easy-to-understand interface that allows you to easily find files and folders and quickly compress and protect them with a password. Files you want to keep safe can be archived, and BetterZip works with popular compression formats such as RAR, ZIP, 7-ZIP, and ISO. The app automatically protects your files and folders with AES-256 encryption and has a password generator for creating and managing secure passwords for files or folders.
BetterZip works through a structure aptly named “Archive”; these are projects to compress and encrypt backups of your files and folders. You can add as many files or folders to an archive as you want and choose where to store the archive after compression.
BetterZip is characterized by the fact that it offers you the possibility to edit files within an archive. If the app detects that you’ve made changes to a document, you have the option to update (recompress) your archive. You can also easily search the archives.
BetterZip is also better than the alternatives for compressed files when it comes to encryption. When you create passwords for zipped files that are archived in BetterZip, the app stores those passwords for you in its built-in password manager. When you try to open an encrypted file or folder in BetterZip, the app uses the saved passwords in its password manager. This helps you create strong passwords that others can’t possibly guess and makes it easier to edit or view files because you don’t have to remember passwords or deal with external password managers.
You can also opt for manual password entry if you don’t want the app to try every password when opening a file. You can also easily make edits in the password manager.
3. Using Archiver
If you want to compress and encrypt files quickly, Archiver might be just the app for you.
Archiver has a straightforward drag-and-drop interface that allows you to drag a file or folder onto the app window. Then all you have to do is click on a button, and a zipped archive of your documents will be created. The app also supports the compression of multiple files or folders and compresses them individually in a batch process.
While compressing files saves space, Archiver also encrypts files and protects them with a password. Here’s how it works:
- Open Archiver on your Mac
- Drag a file or folder to the app’s window
- Select “Archive” at the bottom of the window
- Select the type of zipped file you want to create
- Check next to “Encrypt”
- Enter and confirm your password for the zipped file
- Click “Archive”
That’s all it takes to create an encrypted, compressed file with Archiver.
How to open a password-protected file
There are several ways to open a password-protected file on your Mac. If you know the password and want to view a file, you can open and decompress the file by double-clicking and entering the password.
You can also use Terminal to do this. Here’s how:
- Open Terminal on your Mac
- use the“cd”command above to change the directory where your zipped file is located
- Type this command in Terminal: unzip -P (password)
-d (destination folder)Note: You must replace (password) with the password for the encrypted file, and (destination folder) should be the folder where your file is stored. Do not use parentheses.
- Press Enter
Double-clicking on a folder or file and using Terminal will have a negative effect on your compression, i.e., the encrypted file will be unpacked after opening. BetterZip, on the other hand, does not interfere with the compression of your folders and files. The app allows you to view and edit files within a zipped folder or zipped files yourself. BetterZip will enable you to perform many functions without interfering with compression, and when editing the documents, use the app’s “Save” feature.
Follow these steps:
- Open BetterZip on your Mac
- In the BetterZip window, select the zipped file that you want to view or edit
- If you want to view files, just double-click the file in the compressed folder
- Make any edits, such as changing the file name.B
- When changes have been made, simply select “Save” in the upper left corner of the BetterZip window to save the compressed file or folder again
Compressing and encrypting files or folders on your Mac is essential. This is one of the best ways to protect important documents that you don’t need to access often and sensitive personal data that can be kept on an external drive. Photos, tax documents, personal files, and similar items are perfect candidates for encryption on Mac.
Archiver and BetterZip are two great apps that do a spectacular job for encrypting and compressing files in many formats. Intensive Mac users are likely to find BetterZip’s ease of use for accessing ZIP files beautiful, while others will appreciate the drag-and-drop interface and simplicity of Archiver.
We think these apps are far better options than Terminal, which is a bit cumbersome to use. An incorrect keystroke in Terminal can cause problems, so it’s better to have a visual interface through an app when working with sensitive files or folders.