ccrypt: Simple File Encryption Tool for Ubuntu Linux

In GNU/Linux, there are decent amount of tools with graphical interfaces that make file encrypting a breeze. However, there are also command-line based ones (few!) that let you easily encrypt/decrypt your data as well. Other than not having the ability to use the mouse (plus if you’re not a touch typist), most people don’t like command-line tools because they make you type a bit ;-).

But if you’re willing try a command-line based tool, as long is it lets you easily encrypt/decrypt data (without having to type a lot of commands), then you might be interested in “ccrypt“.

“ccrypt” only supports one algorithm known as “AES”, but it’s considered as an extremely powerful encryption method nonetheless (almost all the major tools support it by default).

It lets you encrypt anything under the sun ;-), whether it’s a MP3 file, document, compressed archive, video file … you name it. “ccrypt” has a handful of options too, but as said before, I just love the way it’s designed, because you can easily encrypt or decrypt a file with minimum efforts (commands). And not to say the least, it also requires very little of your system resources too.

In my honest opinion, it’s actually one of the best tools of its kind that I’ve used so far as well.

Bloody simple, and it works! 😀 …

Few main features …

*. Only supports the AES encryption (256-bit) providing a powerful security over your sensitive data.

*. Lets you use a “key-file” as well. But it’s optional, and for most users, using a powerful password usually provides enough security.

*. By default, after encrypting a file, it deletes the source file. And I don’t think we can bypass that either.

Now this could be a bit of an issue for some. For instance, if you just forgot the newly added password to the encrypted file (yikes!) then you might never be able to access it!. So as a safety precaution, you can move all the files that you want to encrypt to a new folder and can delete the original files later.

*. You basically have two choices while decrypting. You can either permanently decrypt the file OR if it’s a text file for instance, then you can decrypt it temporarily and get the text output to your Terminal window (more at the end of the post).

That’s basically “ccyrpt” in a nutshell folks.

If interested, you can install “ccrypt” in Ubuntu 12.04 Precise Pangolin, 11.10 Oneiric Ocelot, 11.04 Natty Narwhal, 10.10 and 10.04 by using the below command in your Terminal window.

sudo apt-get install ccrypt

Few simple examples (added forcefully 😉)  …

1. Encrypting …

Let’s say that I have a mp3 file named “1” in my Home folder, then I’d use something like the below command to encrypt it with “ccrypt”.

ccrypt 1.mp3

(Please replace “1.mp3” with the name of your own file and its path).

Then it’ll ask for a new password (twice), and that’s it!. The “.cpt” extension will be added to the encrypted file and the original file will be deleted.

2. Decrypting …

Unlike while encrypting, when decrypting you’ll have to use the “-d” attribute, otherwise, “ccrypt” will try to re-encrypt it!.

So to decrypt the above mentioned file, I’d use a command like the below one.

ccrypt -d 1.mp3.cpt

Using the “.cpt” extension is not always necessary. However, as a safety precaution, when typing the encrypted file’s name, always use the added “.cpt” extension as well.


That’s the basic usage and for most users these are the two most important commands necessary (usually).

Optional …

3. Decrypting a file and displaying its content into the Terminal window …

This is only useful for Text files … because other file types (video/audio, a program etc) won’t output a readable content.

So let’s say that I haven an encrypted text document called “test” and need to quickly open its content into the Terminal window (this again only decrypts the content temporarily and as soon as it outputs the content, the file will be encrypted back automatically), then I’d use a command like the below one (we’re using the built in “-c” attribute which enables this feature).

ccrypt -c test

This should output something like the below one (the output of course will change according to your text content).


Again, please replace “test” with the name of own your file and its path.

4. Using a “key-file” …

A key-file is sort of a long password that’s saved in plain text which is used for additional security. So let’s assume that I wanted to encrypted the above mentioned mp3 file using a key-file instead of a password. Then I’d use something like the below command (assuming the key-file’s name is “mykey” and both the key-file and the mp3 files are in my “Home” folder).

ccrypt -K mykey 1.mp3

Just replace “mykey” with your key-file’s location …

Note: That’s capital “K”.

When you want to decrypt the file just use the default decrypt command, and when asked, type the key-file path and it should do the rest.

ccrypt -d 1.mp3.cpt

Replace “mykey” with your key-file’s name & its path (marked in Red)…

5. Changing passwords or the key-file …

If you wanted to change the passwords or the key-file with ease (rather than decrypting and then re-encrypting it using a new password/key-file), then you can use the “-x” attribute.

For instance, if I wanted to change the password/key-file of the above mentioned mp3 file without decrypting it, then I’d use a command like the below one.

ccrypt -x 1.mp3.cpt

When asked, first enter the old password and then the new one after that (twice). That’s it.


It has few other commands which might not be that necessary, but just in case ;-), use the below command to read its manual which explains everything quite well.

man ccrypt

I apologize if my rambling has made it look like a complicated tool. But in truth, “ccrypt” is a pretty simple and a straightforward software application that can be used to encrypt and decrypt files with ease under Ubuntu (or GNU/Linux in general). Good luck.

An RHCE, 'Linux' user with 14+ years of experience. Extreme lover of Linux and FOSS. He is passionate to test every Linux distribution & compare with the previous release to write in-depth articles to help the FOSS community.

13 thoughts on “ccrypt: Simple File Encryption Tool for Ubuntu Linux”

  1. Can CCrypt encrypt whole folders? I'd like to encrypt folders (and their subfolders) with their content in it, but I don't like making .zip or .pgp files. Because what if I have 10 files? Is there a way to decrypt all the files together simultaneously (like ccrypt -a) command if they all have the same password?

    Is there another encryption tool like ccrypt – even better, has a window which asks you for your password without zipping the whole directory?


    • Hell 'SC',

      Well, you cannot encrypt folders with 'ccrypt' unless you've compressed it.

      Also, you can encrypt and decrypt more than a single file at the same time, as long as you're using the same password for the. But in both occasions, you'll have to type their names.

      For instance, if I'm encrypting three files called doc1, doc2 and doc3, then I'll use the below command.

      ccrypt -e doc1 doc2 doc3

      For decrypting …

      ccrypt -d doc1 doc2 doc3

      And you cannot use something like '-a' argument for automatically decrypting/encrypting multiple files without typing their names.

      For your third question, if you're intersted in a more user friendly (GUI) tool that lets you encrypt multiple files with ease (both folders and files …) then I'll recommend using 'truecrypt'

      Installing it in Ubuntu is pretty easy, please refer to the below link (a post I wrote sometime ago) for installing and using it.

      Good luck.

    • SC, based on some of my testing of ccrypt, if you use the -r command it will recurse into the directory and encrypt all files in the directory and subdirectories of the folder.

  2. Great tutorial! It follows the KISS principle. Just want to point out that the capital -K option of ccrypt is for keyword and not for actual key-file. Lowercase -k is used instead for key-file.

    It has been two years since posting this tutorial maybe ccrypt had a few options changed since.

    • Hi ankit,

      Of course. Assuming that the encrypted file is ‘my_text_file.txt.cpt’ and the file containing the ‘key’ is ‘secret_key’, you can use it in the following context within your shell script:

      ccrypt -d -k secret_key my_text_ifel.txt.cpt


Leave a Comment

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