{"id":2792,"date":"2018-01-25T19:53:20","date_gmt":"2018-01-25T16:53:20","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/how-to-install-and-use-tomb-file-encryption-on-ubuntu-1604\/"},"modified":"2018-01-25T19:53:20","modified_gmt":"2018-01-25T16:53:20","slug":"how-to-encrypt-files-with-tomb-on-ubuntu-16-04-lts","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-encrypt-files-with-tomb-on-ubuntu-16-04-lts\/","title":{"rendered":"How to Encrypt Files with Tomb on Ubuntu 16.04 LTS"},"content":{"rendered":"<p dir=\"ltr\" style=\"text-align: left;\">Most people regard file encryption as a necessity nowadays, even on Linux systems. If, like me, you were originally attracted to Ubuntu because of the enhanced security of Linux systems, I\u2019m afraid I\u2019ve got bad news for you: Linux has become a victim of its own success. The vast increase in the number of users over recent years has led to attacks and theft on such systems growing exponentially.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">There used to be a pretty easy solution to encrypting files on Linux systems like Ubuntu: it was called <a href=\"https:\/\/www.fossmint.com\/secure-encrypt-files-folders-with-truecrypt-in-linux\/\" target=\"_blank\" rel=\"noopener\">Truecrypt<\/a>. Up until 2015, it offered varying levels of military-grade encryption, and worked well with most Linux systems. Unfortunately, it has since been discontinued, and has therefore become pretty insecure.<\/p>\n<h2 id=\"the-alternatives\" dir=\"ltr\" style=\"text-align: left;\">The Alternatives<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">Luckily, there are a few alternatives to Truecrypt. The direct successor of Truecrypt was <a href=\"https:\/\/www.fossmint.com\/veracrypt-is-a-secure-alternative-encryption-tool-to-truecrypt-for-linux\/\" target=\"_blank\" rel=\"noopener\">Veracrypt<\/a>, made by a group of developers who took the source code from Truecrypt and kept it updated.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">The project has since grown into an impressive standalone system, but is now showing its age. Old systems, and especially those that deal with security, can only be updated so many times without introducing vulnerabilities.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">For this reason, among many others, it\u2019s worth looking a bit further afield for encryption software. My choice would be Tomb.<\/p>\n<h2 id=\"why-tomb\" dir=\"ltr\" style=\"text-align: left;\">Why Tomb?<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">In some ways, Tomb is pretty similar to other encryption software. It stores encrypted files in dedicated \u201cTomb Folders\u201d, allowing you to quickly see which files you have encrypted.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">It also uses a similar encryption standard to Veracrypt, <a href=\"https:\/\/www.dyne.org\/software\/tomb\/\" target=\"_blank\" rel=\"noopener\">AES-256<\/a>. This standard is Applied by everyone from the NSA to Microsoft to Apple, and is regarded as one of the most secure encryption ciphers available. If you\u2019re new to encryption, it\u2019s worth reading a bit of <a href=\"https:\/\/thebestvpn.com\/advanced-encryption-standard-aes\/\" target=\"_blank\" rel=\"noopener\">the background behind the technology<\/a>, but if you just want fast, secure encryption, don\u2019t worry: Tomb will deliver.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">There are a couple of big differences with Tomb. The first is that it has been developed specifically for GNU\/Linux systems, cutting out some of the compatibility issues of broader encryption software.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">The second is that, although Tomb is open source, it makes use of statically linked libraries so that its source code is hard to audit. That means that it is not considered free by some OS distributors, but when it comes to security software this is actually a good thing: it means that Tomb is less likely to be hacked than completely \u201cfree\u201d software.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Lastly, it has several advanced features like <strong>steganography<\/strong>, which allows you to hide your key files within another file. And though Tomb is primarily a command-line tool, it also comes with a GUI interface, gtomb, which allows beginners to use it graphically.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Sold? Well, before I take you through how to use Tomb, it\u2019s worth noting that no encryption software can offer total protection. Tomb will not hide your online computing from your ISP, and nor does it protect files stored in the cloud. If you want to fully encrypt cloud storage, you\u2019ll need to log into your preferred storage service using the Tor browser and a zero-logging VPN. There are plenty of options available here, but <a href=\"https:\/\/privacyaustralia.org\/trust-zone-vpn-review\/\" target=\"_blank\" rel=\"noopener\">Trust Zone<\/a> is a good browser, and <a href=\"https:\/\/www.howtoforge.com\/tutorial\/how-to-properly-set-up-tinc-vpn-on-ubuntu-linux\/\" target=\"_blank\" rel=\"noopener\">Tinc<\/a> is a good VPN tool.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">All that said, if you are looking for fast, easy, secure encryption for Ubuntu 16.04, Tomb is undoubtedly the way to go. Let\u2019s get you started.<\/p>\n<h2 id=\"installing-tomb-on-ubuntu-\" dir=\"ltr\" style=\"text-align: left;\">Installing Tomb on Ubuntu 16.04<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">Because Tomb was made especially for Linux, install is super easy.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">A couple of years back, the guys over at SparkyLinux (which is a pretty good Debian derivative in its own right) added Tomb to their official repositories. You can install it on your Ubuntu system by adding these repositories.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">To do this, open a terminal and add a repository file:<\/p>\n<p class=\"command\" dir=\"ltr\" style=\"text-align: left;\">sudo vi \/etc\/apt\/sources.list.d\/sparky-repo.list<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">And then add the following lines to the file:<\/p>\n<pre dir=\"ltr\">deb https:\/\/sparkylinux.org\/repo stable main\ndeb-src https:\/\/sparkylinux.org\/repo stable main\ndeb https:\/\/sparkylinux.org\/repo testing main\ndeb-src https:\/\/sparkylinux.org\/repo testing main<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Save and close that file.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">You now need to install the Sparky public key, using either:<\/p>\n<pre dir=\"ltr\">sudo apt-get install sparky-keyring<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Or:<\/p>\n<pre dir=\"ltr\">wget -O - https:\/\/sparkylinux.org\/repo\/sparkylinux.gpg.key | sudo apt-key add -<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">You then need to update your repositories, using the standard command:<\/p>\n<pre dir=\"ltr\">sudo apt-get update<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">And then simply install Tomb using apt:<\/p>\n<pre dir=\"ltr\">sudo apt-get install tomb<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">If you want the GUI, install is just as easy. Just use apt to install gtomb:<\/p>\n<pre dir=\"ltr\">sudo apt-get install gtomb<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">And that\u2019s it: you should now have a working version of Tomb installed. Let\u2019s look at how to use it.<\/p>\n<h2 id=\"using-tomb\" dir=\"ltr\" style=\"text-align: left;\">Using Tomb<\/h2>\n<h3 id=\"using-tomb-through-the-command-line\" dir=\"ltr\" style=\"text-align: left;\">Using Tomb Through The Command Line<\/h3>\n<p dir=\"ltr\" style=\"text-align: left;\">Tomb is primarily a command line tool, so I\u2019ll cover this usage first. If you are not comfortable with using a terminal, you can skip this section and look below.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Actually, scratch that. If you\u2019ve never used the command line before, Tomb is a great place to start, because it uses simple commands and there is little chance of you messing something up as long as you are careful.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Tomb actually uses a pretty amusing set of commands, all graveyard-themed. Each encrypted folder is referred to as a \u201ctomb\u201d, and (as I\u2019ll come to shortly) they can be worked with using similarly Gothic commands.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">First, let\u2019s make a new tomb. You can specify the name and the size of your new tomb, so let\u2019s use \u201cTomb1\u201d, and make it 100mb.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">You need root privileges, so open a terminal and type (or copy):<\/p>\n<pre dir=\"ltr\">sudo tomb dig -s 100 Tomb1.tomb<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">This should give you output similar to:<\/p>\n<pre dir=\"ltr\">tomb . Commanded to dig tomb Tomb1.tomb\ntomb (*) Creating a new tomb in Tomb1.tomb\ntomb . Generating Tomb1.tomb of 100MiB\n100 blocks (100Mb) written.\n100+0 records in\n100+0 records out\n-rw------- 1 Tomb1 Tomb1 100M Jul 4 18:53 Tomb1.tomb\ntomb (*) Done digging Tomb1\ntomb . Your tomb is not yet ready, you need to forge a key and lock it:\ntomb . tomb forge Tomb1.tomb.key\ntomb . tomb lock Tomb1.tomb -k Tomb1.tomb.key<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">As the output helpfully states, you now need to create a keyfile to lock your tomb:<\/p>\n<pre dir=\"ltr\">sudo tomb forge Tomb1.tomb.key<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">If, at this point, you get an error that mentions \u201can active swap partition\u201d, you need to deactivate all of your active swap partititions:<\/p>\n<pre dir=\"ltr\">sudo swapoff -a<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">And then run the keyfile command above.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">It might take a few minutes to generate a keyfile, depending on the speed of your system. After it is done, however, you\u2019ll be asked to enter a new password to secure the key:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-tomb1\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_setup_and_install_tomb_on_ubuntu_1604\/big\/tomb1.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-encrypt-files-with-tomb-on-ubuntu-16-04-lts.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Enter it twice, and your new keyfile will be made.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">You now need to lock your tomb using your new key. You can do this like this:<\/p>\n<pre dir=\"ltr\">sudo tomb lock Tomb1.tomb -k Tomb1.tomb.key<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">You will be asked to enter your password. Do this, and you should get something like the following output:<\/p>\n<pre dir=\"ltr\">tomb . Commanded to lock tomb Tomb1.tomb\n\n[sudo] Enter password for user Tomb1 to gain superuser privileges\n\ntomb . Checking if the tomb is empty (we never step on somebody else's bones).\ntomb . Fine, this tomb seems empty.\ntomb . Key is valid.\ntomb . Locking using cipher: aes-xts-plain64:sha256\ntomb . A password is required to use key Tomb1.tomb.key\ntomb . Password OK.\ntomb (*) Locking Tomb1.tomb with Tomb1.tomb.key\ntomb . Formatting Luks mapped device.\ntomb . Formatting your Tomb with Ext3\/Ext4 filesystem.\ntomb . Done locking Tomb1 using Luks dm-crypt aes-xts-plain64:sha256\ntomb (*) Your tomb is ready in Tomb1.tomb and secured with key Tomb1.tomb.key<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Now everything is set up, you can start using your new tomb.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">A note here: because I\u2019m just showing you what to do, I\u2019ve stored my key and tomb in the same directory (in this case $HOME). You shouldn\u2019t do this \u2013 store your key somewhere else, preferably where no-one but you is going to find it.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">You\u2019ll need to remember where you stored it, however, because you need it to unlock your tomb. To do this, enter:<\/p>\n<pre dir=\"ltr\">sudo tomb open Tomb1.tomb -k path\/to\/your\/Tomb1.tomb.key<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Enter your password, and you should be in. Tomb will generate something like:<\/p>\n<pre dir=\"ltr\">tomb (*) Success unlocking tomb Tomb1\ntomb . Checking filesystem via \/dev\/loop0\nfsck from util-linux 2.27.1\nTomb1: clean, 11\/25168 files, 8831\/100352 blocks\ntomb (*) Success opening Tomb1.tomb on \/media\/Tomb1<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">And then you should see your new tomb, mounted in the finder window.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">You can now save and open files from the tomb, but note that you will need root privileges in order to do so.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">To unmount your tomb after you have finished using it, close it by using:<\/p>\n<pre dir=\"ltr\">sudo tomb close<\/pre>\n<p dir=\"ltr\" style=\"text-align: left;\">Or, if you want to force close all open tombs, you can use:<\/p>\n<pre dir=\"ltr\">sudo tomb slam all<\/pre>\n<h3 dir=\"ltr\" style=\"text-align: left;\"><b>Using Tomb Through The GUI<\/b><\/h3>\n<p dir=\"ltr\" style=\"text-align: left;\">If you are uncomfortable using the command line, or simply just want a graphical interface, you can use gtomb. Unlike a lot of GUI wrappers, gtomb is pretty straightforward to use.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Let\u2019s look at how to set up a new tomb using gtomb. First, launch gtomb from the Menu. It will probably look like this:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-tomb2\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_setup_and_install_tomb_on_ubuntu_1604\/big\/tomb2.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-encrypt-files-with-tomb-on-ubuntu-16-04-lts-1.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Everything is pretty self-explanatory, but for the sake of completeness I\u2019ll run through how to set up your first tomb.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">To start, click on the first option, \u201cdig\u201d. Click OK, and then choose a location.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Next, enter the size of your tomb:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-tomb3\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_setup_and_install_tomb_on_ubuntu_1604\/big\/tomb3.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-encrypt-files-with-tomb-on-ubuntu-16-04-lts-2.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">You\u2019ve now got a new tomb, but you need to make a key before you can use it. To do this, click \u201cforge\u201d from the main menu:<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"><a id=\"img-tomb4\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/how_to_setup_and_install_tomb_on_ubuntu_1604\/big\/tomb4.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/01\/how-to-encrypt-files-with-tomb-on-ubuntu-16-04-lts-3.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Tomb will ask you to enter a passcode twice, so do that.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">Then lock your tomb using the key by clicking, you\u2019ve guessed it, \u201clock\u201d. To open it, click \u201copen\u201d and enter your passcode again.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">As you can see from the screenshot above, usage of gtomb is really easy, and you shouldn\u2019t encounter any problems. Most common tasks can be done with a few clicks, and for anything more complicated you can use the command line.<\/p>\n<h2 id=\"final-thoughts\" dir=\"ltr\" style=\"text-align: left;\">Final Thoughts<\/h2>\n<p dir=\"ltr\" style=\"text-align: left;\">That\u2019s it! You should now have your first tomb set up and ready to go. Store anything you want to keep secret and secure in tombs, and this information will be much more secure.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">You can use multiple tombs at the same time, and bind the files in them to your $HOME directory, so your programs don\u2019t get confused.<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">I hope this guide has helped you get started. Using your tombs is just like using a standard folder, but for more complex commands you can always check the Tomb <a href=\"https:\/\/www.dyne.org\/software\/tomb\/\" target=\"_blank\" rel=\"noopener\">Official Guide<\/a>.<\/p>\n<div dir=\"ltr\" style=\"text-align: left;\">\n<p><b>Share this page:<\/b><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Most people regard file encryption as a necessity nowadays, even on Linux systems. If, like me, you were originally attracted to Ubuntu because of the enhanced security of Linux systems, I\u2019m afraid I\u2019ve got bad news for you: Linux has become a victim of its own success. The vast increase in the number of users &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-2792","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=2792"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/2792\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=2792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=2792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=2792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}