There is often a need to encrypt and/or password protect archive files. Whether you are using them to backup data or share it across the internet, you should take the necessary steps to protect your data. In this quick tip we will examine three ways to create an encrypted and password protected archive in Linux. We will also briefly discuss some pros and cons of each method.
Using tar and gpg to create a secured tar archive.
Part 2: How to Password Protect a Zip from Mac Using Command Line. If you know about the command line, the syntax for the encrypted zip command is like this: zip -e archive file. And if you are going to encrypting two or more than zip files on your Mac using a password, the syntax would be like this: Zip -er archives folder. Xip -x file.xip. Hit return to extract the targeted xip archive. For example, if you’re decompressing a XIP file named “Xcode12beta.xip” that is located on your desktop, then the command would be: xip -x /Desktop/Xcode12beta.xip.
- Aug 24, 2018 Enter 'Terminal' in Spotlight on your Mac computer to open it. Enter these commands to encrypt the chosen files: 'zip -e archivename targetfolder' and 'zip -er archivename targetfolder'. Afterward, you'll see a pop up which will prompt you to enter a password. Do so and hit 'OK'. You'll be asked to verify it.
- Sep 18, 2020 Part 2. Use Terminal to Password Protect Zip File on Mac. Another safe and free method to secure zip files is by using the Terminal or the command line. Launch the Terminal from the Applications Utilities folder; Type the following command: zip -e archivename.zip filetoprotect.txt; Enter the password and verify.
This is the most secure way of creating an encrypted / password protected compressed archive, it is also one of the more complicated. Omniplan pro 3 7 2 – professional grade project management. We will use the tar command to create an archive and pipe it to the gpg command for encryption and password protection. This example specifies the AES-256 encryption algorithm.
After entering the above command you will be prompted for a passphrase.
![Command Command](https://i.pinimg.com/originals/af/14/8d/af148d76c50d50f572166b683c14c7e1.png)
![Zip With Password Command Line Mac Zip With Password Command Line Mac](https://osxtips.net/wp-content/uploads/passwordface-1170x508.jpg)
After entering the passphrase you will be asked to repeat it. Then the archive will be created as an encrypted archive, using a secure algorithm and protected by your custom passphrase.
You will be prompted for the passphrase before the archive is extracted.
I like to always name these types of archives .tar.gz.gpg so I know how they were created. For this example we used tar, gzip and gpg. Also, it is important that you DO NOT forget the passphrase. Adobe lightroom cc 2015 free. If you do, there is no way to recover the data.
Use 7zip to create zip format archives with secure algorithms
Command Line Examples
This is just as secure as the first option since it supports the same AES-256 encryption algorithm, although it does require you put the passphrase or “secret” on the command line, which I am not a fan of. It is also not as convenient because most systems do not come with the P7zip package installed.
To install P7zip on Red Hat, or RH variants like CentOS or Fedora:
or
On Debian based systems such as Ubuntu:
To create the archive, use the command below, replace “PASSPHRASE” with your own secret passphrase.
Example output:
To extract the zip archive use the following:
Use the zip command to create an encrypted archive
The zip command provides options to allow you to encrypt archives. It uses a known insecure PKZIP algorithm and also requires you to add your passphrase on the command line. The benefit of this method is both Linux and Windows folks can extract the archive without any additional software.
Simply add the --password option to the zip command like so:
Remember to replace PASSPHRASE with your password.
Example output:
To extract the archive, use the normal unzip utility. The only difference is you will be asked for a password.
Conclusion
So there you have my three favorite ways to created encrypted archives. There are plenty more ways to accomplish this (openssl, gpg-zip, bcrypt) and some are better than others. If you data is really important, I suggest you read up on the different algorithms and signing methods that are out there and decide for yourself which is right.
Whatever method you use it is important to NOT forget your passphrase.