Ubuntu – How to encrypt data in cloud storage services like Dropbox


I'd love to use Ubuntu One or Dropbox features, like file storage and so on, but I don't want anyone else to access my data, USA Patriot act etc.. I want things to be encrypted so that the only place where info is decrypted is only my devices. Is that possible with Ubuntu One or Dropbox?

Best Answer

Yes it is possible. The best way to archive this with a per file encryption is with encfs:

The general principle is that you have a (optionally hidden) encrypted folder inside UbuntuOne/Dropbox where your files are stored, but you access them though another folder, where the decrypted files are shown. Any File you add to the decrypted folder will be encrypted and put into the encrypted folder:

Decrypted folder ←encfs→ Encrypted Folder (inside UbuntuOne/Dropbox)

On another computer the encrypted folder is synced by UbuntuOne/Dropbox and can also be decrypted on the fly.


  • Install encfs version 1.7 or greater

    sudo apt-get install encfs
  • install gnome-encfs-manager:

    sudo add-apt-repository ppa:gencfsm/ppa
    sudo apt-get update && sudo apt-get install gnome-encfs-manager

Setting up the Drive on the first computer:

  • Create a (hidden) directory inside Dropbox/Ubuntu One to use as for the encrypted files
  • Start gnome-encfs-manager and set up a new stash (click on the plus sign)
  • Set the directory to encrypt to a (hidden) folder inside your Dropbox/Ubuntu one folder
  • Set the mount directory wherever you want (default is fine)
  • enter a good password (30 random chars...) and click "Create"
  • edit the new stash so it is mounted on startup and the password is saved in the gnome keyring

You should now have your encrypted drive mounted (it will be displayed like a mounted usb-drive)

Importing the drive on other computers:

  • Wait for all files to sync
  • Start gnome-encfs-manager and set up a new stash
  • Set the directory to the previously created folder inside your Dropbox/Ubuntu
  • encfs-manager will detect the drive and import it
  • Set the mount directory wherever you want (default is fine) and click "Import"
  • edit the new stash as desdribed above
  • you will be asked for your password on first mount

Cross Platform compatibility:

  • This is cross compatible with Android when using Encdroid (open source, recommended) or Cryptonite (open source). Both Android Apps support Dropbox and should also work with UbuntuOne using local folder decryption (in combination with an UbuntuOne client which syncs your files onto the SD Card)
  • This is probably also compatible with windows using encfs4win or other software.
Related Question