1. Home
  2. Linux
  3. Encrypt dropbox data on linux

How to encrypt Dropbox data on Linux

As far as mainstream cloud services go, many Linux users argue that Dropbox is one of the best. The reason? They (despite some mishaps in recent months) support Linux users, offer up a native syncing client and overall it works well. Still, for as useful as Dropbox can be on Linux it has some questionable privacy practices which can make users who care about their data online nervous.

If you’re committed to using Dropbox on Linux but are looking for a quick and simple way to encrypt Dropbox data, you may be interested in CryFS. It’s a useful program that lets users create vaults to lock up their data on Linux.

Use a VPN with Dropbox

In this guide, we’ll teach you how to encrypt Dropbox data on Linux with CryFS. For the most part, the CryFS tool does an excellent job of protecting your privacy and data for Linux. Still, no program is 100% effective, and issues can occur. To ensure that your privacy is always safe, even when using encryption tools like CryFS, we recommend using a VPN.

ExpressVPN takes the top spot as the best VPN reviewed by our security experts. It works well on Linux and has an excellent client for download. Better still, they offer fast download speeds with 256-bit AES encryption and perfect forward secrecy across 94 different countries. Also, they have an exclusive offer for AddictiveTips readers: 3 months free on the annual plan, a 49% discount.

Install CryFS

The encryption tool we’ll be using to encrypt Dropbox data is CryFS. It’s a simple tool that lets users create vaults. In these vaults, everything is encrypted and locked away, safe from employees at Dropbox, or anyone looking to get access to your private data in the cloud.

The CryFS tool is entirely command-line based. However, as it’s not the standard encryption program on Linux, it doesn’t come pre-installed out of the box. Thankfully, CryFS is quite easy to install. To get it going on your setup, launch a terminal window and follow the instructions that correspond to your distribution.

Ubuntu

sudo apt install cryfs

Debian

sudo apt-get install cryfs

Arch Linux

sudo pacman -S cryfs

Fedora

For some reason, the CryFS tool isn’t in the Fedora Linux software repository. Therefore, if you’d like to use it, you must build it from source. The first step in the build process is using the DNF command to install the CryFS build dependencies.

sudo dnf install git gcc-c++ cmake make libcurl-devel boost-devel boost-static openssl-devel fuse-devel python -y

With the build dependencies taken care of, use the Git tool to grab the source code.

git clone https://github.com/cryfs/cryfs.git cryfs

Move the terminal into the code directory using CD. Then, build CryFS from source on your Fedora Linux machine.

cd cryfsmkdir cmake && cd cmake
cmake ..
make

Finish up the process by installing CryFS with make install.

sudo make install

OpenSUSE

sudo zypper install cryfs

Creating vault folders

Using CryFS requires two directories: the vault folder that holds the files when they are not in use and the mount folder, where the vault will be accessible when not encrypted. In this section, we’ll go over how to create the vault directory.

In a terminal, use the CD command and move the session from the home directory (~/) into your Dropbox sync folder on Linux.

cd ~/Dropbox

Run the ls command and take a look at your Dropbox sync folder. Determine where you’d like to keep the CryFS vaults.

ls

When you’re sure about where to put the folder, use the mkdir command. Be sure to add the -p switch as it will ensure that the folder keeps the same permissions as the parent Dropbox directory.

mkdir -p cryfs-vault

Create the mount folder

After taking care of the CryFS vault folder in your Dropbox directory, it’s time to make another one. This directory is where you’ll mount and access your data, so be sure not to put this one in Dropbox too. Instead, place it somewhere in ~/ or ~/Documents.

cd ~/
mkdir -p cryfs-mount

Or, if you prefer to mount via the Documents folder, do:

cd ~/Documents
mkdir -p cryfs-mount

Mount CryFS

Now that the folders are done, it’s time to create and mount a vault. In the terminal, execute the cryfs command and specify both the vault folder and the mount folder.

Note: always remember to put the mount folder last! If you specify the Dropbox vault folder first, your vault data will not sync!

Note: you must mount your CryFS vault each time, before trying to encrypt any files.

cryfs ~/Dropbox/cryfs-vault ~/cryfs-mount

Or, for those who prefer the Documents folder:

cryfs ~/Dropbox/cryfs-vault ~/Documents/cryfs-mount

Encrypt your data

Once the vault is mounted via CryFS, encrypting is quite easy. To do it, open up your Linux file manager and browse to “Home,” then “cryfs-mount”. Or, if your mount is in the Documents folder, go “Home,” then “Documents,” and “cryfs-mount.”

Drag the files you’d like to encrypt in Dropbox into the mount folder. Then, when you’re done using the vault, unmount it with the following terminal command.

Note: be sure to swap out “username” in the command below with the user name on your Linux PC.

fusermount -u "/home/username/cryfs-mount"

Or:

fusermount -u "/home/username/Documents/cryfs-mount"

When the vault is unmounted, Dropbox will begin to start uploading your encrypted data to the service.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.