Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What's the most popular way to do that?

share|improve this question
Question is a bit unclear. Do you want to manually encrypt and decrypt files, or on the fly? –  psusi Feb 23 '11 at 19:15
Instead of 'most popular' , fitting a solution to your requirements might be helpful (as per psusi's question). Are you looking for a combination of easy, reliable, native, secure, fast, open source? All or some of these? –  belacqua Feb 23 '11 at 19:23
I'd like to add the remark that contrary to what some answers claim, TrueCrypt is not considered Free Software or Open Source by Debian/Ubuntu/Fedora/Red Hat/Arch Linux/OpenSuse/Gentoo/etc. –  JanC Feb 23 '11 at 22:02
add comment

7 Answers

I use Seahorse for this. It's a Gnome front-end for GnuPG and integrates well with nautilus: Nautilus integration

To get nautilus integration, install the package seahorse-nautilus from the Software Center. seahorse-nautilus Install seahorse-nautilus

share|improve this answer
this only works if you have a GPGs keys created in your system ... –  hhlp Feb 23 '11 at 19:33
@hhlp: djeikyb's answer explains how to do that. –  pydave Mar 25 '11 at 18:21
add comment
  • TrueCrypt - Free Open-Source Disk Encryption Software -> HowTo
  • EncFS system tray applet for GNOME cryptkeeper Install cryptkeeper
  • You can also activate your private folder in ubuntu -> Howto
share|improve this answer
+1, encfs - with or without a GUI - is very useful and enough for most purposes. –  loevborg Feb 23 '11 at 18:58
Cryptkeeper is awesome - simple, powerful and a breeze to set up with Dropbox (askubuntu.com/questions/19613/…). –  Scaine Feb 23 '11 at 20:27
TrueCrypt is not packaged in Ubuntu (or any other major distributions) for licensing concerns. –  MagicFab Oct 1 '13 at 23:08
Cryptkeeper works perfectly on Linux Mint 14 –  Fedir Oct 17 '13 at 14:51
TrueCrypt is not that open-source. en.wikipedia.org/wiki/… –  YuriC Dec 20 '13 at 1:42
add comment

For single files, openssl is very useful, especially when sending the file over an unsecured channel (e.g. e-mail). It's free (in money and in freedom), unlike Truecrypt, which is only free in money.


openssl aes-256-cbc -salt -in unencrypted_file -out encrypted_file

You'll be asked for a password, which you have to input twice.


openssl aes-256-cbc -d -in encrypted_file -out unencrypted_file

Manual page

share|improve this answer
Is there a way to do this without a passpharse? –  Assaf Lavie Mar 2 '11 at 4:32
@Assaf Lavie: OpenSSL does not support keyfiles if you meant that, although it can read a password from the first line of a file. Read the manual page on openssl, section Pass phrase arguments. –  Lekensteyn Mar 2 '11 at 14:32
additionally you can use the "-a" flag which allows you to copy the crypted text, like so: "openssl aes-256-cbc -a -salt -in unencrypted_file -out encrypted_file " –  v2r Feb 24 '12 at 17:06
@v2r To add for further readers: -a base64-encodes the input (alias of -base64), to decrypt it you also need to add the -a option. –  Lekensteyn Feb 24 '12 at 17:14
@Lucio aes-256 is an alias for aes-256-cbc, there is no difference. CBC is a mode of operation for block ciphers. See the manual page of enc(1) for a list of supported ciphers. –  Lekensteyn Dec 19 '13 at 10:21
show 1 more comment

A cli method would be GnuPG, and maybe tar. This is a short guide for reference, you really should read the documentation.

First run gpg --gen-key. Follow the prompts to generate your public/private key pair. Now you can encrypt files: gpg -e foo.txt. This will create a file called foo.txt.gpg. GnuPG does not delete the original unencrypted file, it's up to you whether you want it hanging around. To decrypt foo.txt.gpg, run gpg foo.txt.gpg. Decrypting will prompt you before overwriting existing files.

If you need to encrypt a directory, tar it first:

tar -cf foo.tar foo/
gpg -e foo.tar

You can rename the encrypted file whatever you want. When decrypted, the original file name is preserved.


The GnuPG manual: http://www.gnupg.org/gph/en/manual.html

A mini-howto: http://moser.cm.nctu.edu.tw/gpg.html

share|improve this answer
The advantages of this method are: First it does not require installation of additional packages; Second it does not require root access. I would add compression to the tar command (xz or gz). –  bodhi.zazen Dec 20 '13 at 2:20
add comment

There's also eCryptfs, which Ubuntu uses to encrypt Home Directories.

You can select home directory encryption at installation, or you can setup a single directory, $HOME/Private by default, using the ecryptfs-setup-private utility. This folder can be configured to automatically mount at login and unmount at logout. Every single file and folder within $HOME/Private, recursively, will be encrypted.

share|improve this answer
Unfortunately eCryptfs is VERY slow. Also there are few bugs in latest version –  ruX Jan 30 '13 at 13:10
add comment

When I encrypt files and things I use the tool Truecrypt, I find it works across all platforms. And its free and open source. I have been using it for several years without problems. Truecrypt

share|improve this answer
add comment

You may also use "Academic Signature" to use elliptic curve cryptography with a wxWidgets GUI. It is open source but not in the repositories. It mainly does ECC asymmetric encryption, signatures and timestamps. But the tool also has a Menu entry for invoking Gnupg(RSA) and direct access to symmetric en-/decryption of files offering AES and other algorithms. Its homepage is here: http://www.fh-wedel.de/~an/crypto/Academic_signature_eng.html

I use it a lot for protecting files in transit and for digitally signing academic documents(transcripts, letters of recommendation, grade lists etc.)

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.