Today, we are going to learn about how to install and Use VeraCrypt to Encrypt Drives on Ubuntu 18.04.
So what is VeraCrypt? VeraCrypt is an open-source software forked from TrueCrypt whose development and maintenance has since been discontinued. It is used for performing on-the-fly disk encryption (OTFE). On-the-fly encryption means that data is encrypted before it is written to the disk and when data is being read from the disk, every small portion of it is copied and decrypted on the fly in the memory (RAM) without human interaction i.e no decrypted data is stored on the memory temporarily and thus, even when the disk is mounted, data is still encrypted.
VeraCrypt encrypts the entire filesystem of the disk including folders, files, contents of the files, metadata, free space…In order to access the encrypted data, one has to supply the encryption keys, password or keyfile.
You can read more about VeraCrypt in its Documentation page.
You can also check our previous article on how to Encrypt Files and Folders with eCryptFS on Ubuntu 18.04.
Install VeraCrypt on Ubuntu 18.04
There are two ways in which VeraCrypt can be installed on Ubuntu 18.04
Installing via Ubuntu PPA repos
VeraCrypt is not available on the default Ubuntu repositories. Therefore, to install it using the package manger, you have to add the PPA repositories.
Add PPA repos using the command below. Note that this repository is not related to VeraCrypt even though Unit 193 is Xubuntu developer and he is a great contributor to open source community;
sudo add-apt-repository ppa:unit193/encryption
Update the system
sudo apt-get update
Once the update is done, run the command below to install VeraCrypt.
sudo apt install veracrypt
Install via VeraCrypt Installer Scripts
VeraCrypt has its Linux installer scripts on its official website. Download the installer tarball by running the command below.
Once the download is complete, extract the VeraCrypt tarball, navigate to the source code extract directory and run the VeraCrypt installer.
tar -xjf veracrypt-1.23-setup.tar.bz2
This will extrct the VeraCrypt setup scripts in the current working directory. There are two types of installers, GUI based and the console based Installers for both x86 and x86_64 systems. In this case, I am going to use the console based installer for x86_64 system.
Therefore, in the current working directory, run the installer script as shown below;
VeraCrypt 1.23 Setup ____________________ Installation options: 1) Install veracrypt_1.23_console_amd64.tar.gz 2) Extract package file veracrypt_1.23_console_amd64.tar.gz and place it to /tmp To select, enter 1 or 2: 1 << Press 1 to Launch VeraCrypt installation Before you can use, extract, or install VeraCrypt, you must accept the terms of the VeraCrypt License. Press Enter to display the license terms... ...scroll through the license... Do you accept and agree to be bound by the license terms? (yes/no): Yes ...Once you press Enter, the installer will run and install VeraCrypt... usr/share/veracrypt/doc/HTML/VeraCrypt Rescue Disk.html usr/share/veracrypt/doc/HTML/VeraCrypt128x128.png usr/bin/ usr/bin/veracrypt-uninstall.sh usr/bin/veracrypt Press Enter to exit...
You can verify that VeraCrypt is installed and indeed is in your PATH.
which veracrypt /usr/bin/veracrypt
You are now ready to encrypt your drives/files using VeraCrypt.
Use VeraCrypt to Encrypt Drives on Ubuntu 18.04
In this guide, we are going to learn how to use the GUI method of VeraCrypt to encrypt devices/files.
To launch the VeraCrypt GUI, press the Super Key to launch activities search bar and type veracrypt.
Press Enter to Launch VeraCrypt
The numbered slots, 1, 2… are used by VeraCrypt to manage encrypted devices.
Create VeraCrypt Volume
There are two types of VeraCrypt Volumes;
- File-hosted (container)
File-hosted volume is a normal file that can be stored on any storage device. It contains an independent encrypted virtual disk device while Partition hosted volume is a hard drive partition. It can be a removable USB sticks or any other type of storage.
To create a VeraCrypt volume, click on the Create Volume button. You will be prompted to choose the type of the volume, File Container or a Partition. In this guide, we are going to create an encrypted partition. If you opt to create an encrypted file container, the process it the same.