Going Linux Screencast 8 — Installing and Using VeraCrypt

22:251 speaker
21:42
duration
6
chapters
8
Highlights
8
Terms
VeraCryptdisk encryptionLinux installDropbox sync

Key ideas

7
  • VeraCrypt provides on-the-fly encryption for file containers, partitions, and devices.
  • Download the correct VeraCrypt installer for your OS architecture (32-bit vs 64-bit).
  • Run the installer from a terminal and accept the license to install on Linux.
  • VeraCrypt volumes are just files (containers) and can be moved or deleted like any file.
  • Choose appropriate filesystem format: ext4 for Linux-only, FAT/NTFS for cross-platform compatibility.

Key highlights

8
  • Installer on CodePlex has a misleading purple button that downloads the Windows build; use the Downloads list to pick the Linux package.
  • Use uname -a to determine whether the OS is 32-bit (i686) or 64-bit.
  • Run installer scripts from terminal using ./<installer-name> and choose install option.
  • VeraCrypt offers a Volume Creation Wizard with options: file container, partition/device, standard or hidden volume.
  • If you select an existing file path during creation, VeraCrypt will overwrite that file.

Decisions

5
  • Use the Linux graphical installer appropriate for the system architecture (x86 32-bit in the demo).
  • Create a standard VeraCrypt volume (not a hidden one) for the demonstration.
  • Name the test container file MyTestVolume.ppt and place it in Documents to disguise it as a presentation file.
  • For a Linux-only test volume choose ext4 filesystem; for a cross-platform Dropbox-shared volume choose FAT.
  • Store the KeePassX database inside a VeraCrypt container on Dropbox and ensure only one computer mounts it with full read/write access at a time (or mount read-only from multiple systems).

Terms

8
VeraCrypt — Cross-platform encryption tool that creates and manages encrypted volumes (containers, partitions, or devices) with on-the-fly encryption.
On-the-fly encryption — Automatic encryption/decryption of data in RAM as it is written to or read from an encrypted volume without user intervention.
Container (VeraCrypt volume) — A normal file that holds an encrypted filesystem; can be moved or deleted like any file.
Mount — The operation that makes an encrypted VeraCrypt volume accessible as a virtual drive/slot in the OS.
Slot (Linux VeraCrypt UI) — A placeholder in VeraCrypt's main window where volumes are assigned before mounting (analogous to drive letters on Windows).

Main content

6 chapters · 21:42
0:00

1. Introduction and VeraCrypt overview

Speaker A0:00

Going Linux Screencast number 8, Installing and Using VeraCrypt. Welcome to this Going Linux screencast. I'm your host, Larry Bushey. In this screencast, we will be covering how to install and use VeraCrypt software.

For this episode, we used an HP G60 notebook computer, Ubuntu MATE 15.04 32-bit operating system, VeraCrypt version 1.0f-2 cross-platform file and volume encryption software, Dropbox, cross-platform file storage and synchronization software, and KeePassX 0.4.3 cross-platform password manager. VeraCrypt is cross-platform software for creating and maintaining on-the-fly encrypted volumes for data storage. The on-the-fly encryption happens without any user intervention, right before the information is saved, and it is decrypted right after it's loaded. You need the correct password or encryption keys to encrypt a file on a VeraCrypt volume, and VeraCrypt encrypts the filenames, folder names, contents of every file, free space, and metadata—everything in the file system.

1:40

2. Downloading and installing VeraCrypt

Speaker A1:40

Installing VeraCrypt. Let's start by downloading VeraCrypt from its home on CodePlex. Open a browser and go to veracrypt.codeplex.com. On the VeraCrypt main page, there's a big purple download button. Don't click it unless you want the Windows version. It's not one of those download buttons that auto-detects your operating system and downloads the correct version for you. Scroll down below the various buttons to the link for all of the downloads, or just click the Downloads tab at the top. Again, you'll see a purple download button. Still does the same thing, ignore it. Scroll down to the link for the Linux version and click it. The next screen says that it's downloading, and a dialog box appears confirming that you want to download the file. Click Save File to begin the download.

In Firefox, you'll see the download progress. Now, let's find the file using the file manager. You'll notice that the file for Linux is in a tar.bz2 format. For those of you not familiar with file compression on Linux, think of this as a zip archive file. Let's extract its contents. On Linux, that's easy to do. Just double-click the file to open it in the archiving program installed by your distribution. You'll see all of the files contained in the archive. Click Extract and tell it where to put the files. I'm going to put them right in the Downloads folder and delete them later. Click Extract, and when the file extraction completes, Quit the Archive Manager.

You'll notice several different versions of the setup program. These are installation programs that are each designed for either x86 32-bit operating systems or x64 64-bit operating systems. You'll also see that there's a command line or console version and a graphical or GUI version of each. We'll use the graphical installer, but we'll need to know if the OS is 32-bit or 64-bit. If you install the wrong version, when you launch VeraCrypt for the first time, it will show only a blank white screen.

On Ubuntu and its derivatives, to determine what kind of OS you have, open a terminal and type uname -a. You can see here that the listing shows i686 for each of the processors in this machine, so I want to use the x86 installation file. Since the installer runs an installation script, we'll run it from the command line. It's easy. Without pointing at a file, right-click in the File Manager window and choose Open in a Terminal from the menu. I'll type ls to get a listing of the files in the folder, just to confirm that I'm in the right folder.

Now, to run any script from the command line, you type ./, or the period and the slash symbol. This lets the OS know that you want to run the script, not just view it. Without leaving a space after the slash, type the name of the installer file to run. I'll type a few letters, then press the Tab key to complete as much of the filename as possible, then type the next letter and press Tab again until the right filename appears, then press Enter to start the installer.

You now have the option of completing the installation or just extracting the files contained within the installer package. Choose the install option by typing 1, and Enter. VeraCrypt requires that you accept its license terms before the installation, so press Enter. The first page of 10 or 20 screens of text appears. Press the spacebar to page through the license. Once you reach the last page, you're prompted to accept the terms. Type the word yes and press Enter. Once the installation is finished, you'll notice that on the screen, the installer lets you know how to uninstall VeraCrypt using the command veracrypt-uninstall.sh. Press Enter to quit the installation.

The VeraCrypt application will now appear in the menu, usually under the Accessories category. Click the icon to launch it, and the main screen will appear.

6:50

3. Creating and mounting a VeraCrypt volume

Speaker A6:50

Creating an encrypted volume. Before we create our first volume, VeraCrypt provides easy-to-follow instructions in their manual. The manual is accessible both within the application and online. To find the in-app help, from the main menu, select Help, User's Guide. The manual starts off with a beginner's tutorial that includes how to create a container and how to create an encrypted hard drive partition, USB stick, or other device.

I've opened VeraCrypt on the left side and the manual on the right side to show you that although the screenshots are from a Windows machine in the manual, the user interface on Linux is almost identical, so you should be able to follow along quite easily. You'll notice a slight difference in the main window. Under Windows, you can mount VeraCrypt volumes as virtual hard drive partitions, like E:, F:, G:, etc., and the VeraCrypt main screen allows you to select that drive letter for opening a volume and mounting it. VeraCrypt under Linux also mounts the volumes as virtual hard drive partitions, but the main screen gives you what it calls slots to use for holding the volumes before you mount them. In the VeraCrypt main window, Linux slots and Windows drive letters work exactly the same way. You'll see that the rest of the buttons and selections are identical on this screen.

Now let's create our first volume. Click Create Volume. VeraCrypt starts the Volume Creation Wizard that will walk us through the steps. In this step, you need to choose where you want to put your VeraCrypt volume. A VeraCrypt volume can reside in a file, in a partition, or drive on your computer. We will choose the first option and create a VeraCrypt volume in a file. Click Next. Now you'll choose whether to create a standard or a hidden VeraCrypt volume. I'm going to create a standard VeraCrypt volume. Click Next.

In this step, you have to specify where you want the VeraCrypt volume created. Note that a VeraCrypt container is just like any normal file. It can be moved or deleted like any normal file. Also note the warning on the screen. Don't select an existing file unless you want it deleted. If you choose an existing file, VeraCrypt doesn't encrypt it. It deletes the old file and creates a new encrypted one with the same name. In the next step, you can specify a new file and a new filename. Click Select File. Select the path where you want the container to be created. I'm going to put it in the Documents folder. Then type the filename. Since VeraCrypt lets you name your file anything you want, I'll call mine MyTestVolume.ppt. Presentation files can be pretty big, so to the casual observer, this will look like a simple PowerPoint file. Click Save. The Volume Creation Wizard now shows the path and the name of the file. Click Next.

Now you choose an encryption algorithm and a hash algorithm for the volume. If you're not sure what to select here, you can use the default settings and simply click Next. Now I enter the size of our VeraCrypt container. I'll make it 20 MB just as a test. You can make it any size you like, bigger or smaller. I can make this file as big as the 422 GB of available space on my hard drive. Click Next. Here you have to choose a good password for your volume. VeraCrypt offers suggestions as to what makes a good password right on this screen. Type your password into both input fields. Then click Next.

If your password is too weak, VeraCrypt provides a warning. If you get the warning, click OK and consider using a more secure password. Now you can choose the file format you want to use with the VeraCrypt volume. The most compatible formats are NTFS and FAT. Since I'm just testing this on Linux, I'll choose ext4 and click Next. Since I chose a Linux file format, VeraCrypt lets me know that other operating system platforms may not be able to use the volume. If I don't say that I'm using the volume only on Linux, VeraCrypt tells me that if I choose a format designed for Linux, if I plan on sharing the volume with other operating systems, they may not be able to read the files, or they might require special drivers or utilities to make this possible. Click OK and then click Next.

Normally, you would move your mouse as randomly as possible within the VeraCrypt creation wizard window for at least 30 seconds or so. This motion helps VeraCrypt create strong encryption keys. For this test, I'll just click Format. VeraCrypt now begins creating the volume. It creates a file called mytestvolume.ppt in the Documents folder. This file will contain the encrypted VeraCrypt volume. Depending on the size of the volume that you create, the volume creation step might actually take quite a bit of time. When it finishes, you'll be asked for your Linux administrator password. That's because, from a Linux perspective, we're making a system change that requires administrator permission to be secure.

The virtual disk will be entirely encrypted, including file names, allocation tables, free space, and so on, and it will behave just like a real drive partition. Files that are being read or copied from an encrypted VeraCrypt volume are automatically decrypted on the fly in RAM memory. Similarly, files that are being written or copied to the VeraCrypt volume are automatically encrypted on the fly in RAM right before they're written to the disk. VeraCrypt never saves any encrypted data to a disk. It only stores it temporarily in RAM memory. Even when the volume is mounted, data stored in the volume is still encrypted when you restart or turn off your computer. The volume will be dismounted, and all files stored on it will be inaccessible and encrypted.

Once the volume is created, click OK to close the dialog box. Our first VeraCrypt volume is ready to use, so click Exit to close the wizard. Now let's mount the volume to see how it works. Select the slot from the list where you want your VeraCrypt container to be mounted. Notice that the volume file we just created is already selected, so to begin using the VeraCrypt volume, we just need to click Mount. VeraCrypt asks for the password we gave to the VeraCrypt volume so that it can unencrypt it before mounting it. Now type the password and click OK. If you open a file stored on a VeraCrypt volume, in a media player for example, the file will be automatically decrypted to RAM, on the fly, when it's being read.

Once my volume is mounted, you'll see that Linux has opened it in what looks like a 21 MB hard drive partition named VeraCrypt1. You can see that the virtual drive is empty. Let's test it out by copying my background wallpaper file into the virtual drive. My wallpaper is in the Pictures folder. I'll just drag it from here and drop it here. Click on the virtual drive, and there it is.

15:24

4. Using VeraCrypt with Dropbox and KeePassX

Speaker A15:24

Storing encrypted volumes on Dropbox. Now I'd like to encrypt my KeePassX passwords database file and share it on Dropbox so that the same passwords are accessible on all of my computers. We'll start off the same way, choosing a standard VeraCrypt volume. This time, when we select a location, we'll choose the Dropbox folder. Here's my existing KeePassX database in an unencrypted location. Although Dropbox encrypts the file, I'd like to add an additional layer of encryption by putting it inside a VeraCrypt volume.

Let's see, what shall I name my file? Secrets? No, that would attract too much attention. Passwords? No, that's just as dumb. I know! BoringPresentation.ppt. Yep, that'll do. Click Save, Next, and Next. Now the KeePassX file is pretty small. Let's keep this volume at 20 megabytes. That should do. Give it a good password and click Next. Now the file format—since KeePassX is cross-platform, I want a file format that will work for Linux, Windows, and OS X. Since the files in the VeraCrypt container will be small, FAT will be fine.

Now let's let VeraCrypt create, format, and encrypt the volume for us. Storing the VeraCrypt volume on Dropbox allows multiple computers, even with a different operating system on each, to mount the shared file. But for full read/write access, in order to prevent data corruption, the shared volume must be mounted with full access by only a single computer at a time. If multiple systems need to access the volume simultaneously, they must mount the volume in a read-only mode. The VeraCrypt documentation is really good. It contains a section on mounting a volume in read-only mode.

Okay, the volume's ready. Let's take a look. Open the Dropbox folder. Yep, there it is. But we can't simply drag the KeePassX file over to the VeraCrypt container yet. It's not mounted, so let's go do that. Let's select the slot and select the file in the Dropbox folder. Mount the volume with the password we gave it. Provide the administrator password for our computer. And we're in.

Opening the Dropbox folder, you can see our container file here. And it's now open as our 21 MB volume here. Now let's copy the background wallpaper file like we did before by dragging and dropping the file. There it is. Now let's open KeePassX. Enter the master password, and when we open it, KeePassX opens the database that currently resides in the unencrypted Dropbox folder. From the menu, we could create a new empty database, but that isn't exactly what we want. We want to move the existing database containing all the passwords, then open it from its new location.

Let's do that. After closing KeePassX, we go to the Dropbox folder and find the database file. Holding down the Shift key to force a file move instead of a file copy, we drag the database file into the encrypted volume. There it is. Now let's reopen KeePassX. It can't automatically open the database as it did before, since we moved it. Select File, Open Database, navigate to the VeraCrypt volume, then select and open the database. Provide the master password, and now KeePassX is using the database in the encrypted volume.

20:28

5. Unmounting, remounting, and access considerations

Speaker A20:28

VeraCrypt volume. We'll close KeePassX. Now let's illustrate what happens to KeePassX when the VeraCrypt volume is not mounted. Open VeraCrypt. Dismount the volume. And now we'll reopen KeePassX. The application cannot open the database since it's no longer accessible.

When we remount the volume, provide the password word, and make the database file accessible once again, the password database is available to KeePassX to use again. Remember that you need to either mount a volume shared on Dropbox from only one computer at a time, or you need to mount it read-only. The VeraCrypt manual gives instructions on how to mount a volume read-only.

The read-only method isn't ideal for managing passwords, since it'll prevent you from creating new entries in your KeePassX database. For that particular scenario, it might be more convenient to mount and dismount the volume from each computer as you need to use it. There are plenty of other scenarios where read-only access will work just fine.

21:42

6. Conclusion and credits

Speaker A21:42

This Going Linux screencast is one in a series of screencasts produced by the Going Linux team as part of the Going Linux podcast. This concludes our Going Linux screencast. Thanks for watching. Theme music provided by Mark Blasco at podcastthemes.com.