Close Menu
    X (Twitter)
    Hectic GeekHectic Geek
    • Apps
      • Apps for Mac
      • Apps for PCs
      • Best Apps
    • Concepts
      • Comparison
      • For Geeks
      • IT Careers
    • Gadgets
      • Accessories
      • Best Work Laptops
      • Budget Laptops
    • GNU/Linux
      • Ubuntu
    • How To
      • Virtualization
      • Windows
      • Windows How-To
    Hectic GeekHectic Geek
    Home » ccrypt: Simple File Encryption Tool for Ubuntu Linux
    Ubuntu

    ccrypt: Simple File Encryption Tool for Ubuntu Linux

    GayanBy GayanFebruary 27, 2012Updated:September 28, 201213 Comments6 Mins Read
    Twitter Reddit Telegram WhatsApp Email
    Share
    Twitter Reddit Telegram WhatsApp Email

    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.

    Share. Twitter Reddit Telegram WhatsApp Email
    Gayan

    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.

    Related Posts

    How to Check Linux CPU Usage?

    February 5, 2024

    Linux export Command: A Comprehensive Tutorial

    February 3, 2024

    Debian vs Ubuntu Server: A Brief Comparison for Beginners

    July 2, 2023

    CPU Based Simple System Stability and Benchmark Tester for Ubuntu Linux – systester

    June 16, 2023

    Typespeed: Typing Speed Testing Game for Ubuntu Linux

    March 12, 2023

    Debian vs Ubuntu in 2023- Which Linux OS is Right for You?

    January 6, 2023

    13 Comments

    1. SC on August 11, 2012 7:00 am

      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?

      Thanks

      Reply
      • Gayan on August 11, 2012 4:08 pm

        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.
        https://hecticgeek.com/2011/12/best-encryption…

        Good luck.

        Reply
      • Ryan on March 4, 2013 4:58 am

        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.

        Reply
        • Gayan on March 4, 2013 6:22 am

          Thanks Ryan!.

          Reply
    2. John on December 15, 2013 6:27 am

      Thanks for posting this. Good tutorial on a easy to use, very useful tool.

      Reply
      • Gayan on December 15, 2013 7:12 am

        Thank you John :).

        Reply
    3. Bond007 on April 18, 2014 3:04 pm

      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.

      Reply
      • Gayan on April 19, 2014 6:35 am

        You could be right. Thanks.

        Reply
    4. Miguel on August 22, 2014 5:57 am

      thank you

      Reply
      • Gayan on August 22, 2014 8:18 am

        You’re welcome.

        Reply
    5. Rick on July 20, 2015 2:01 am

      Does not work !!! even with simple text files in Ubuntu 14.04

      Reply
    6. ankit on August 19, 2015 4:13 pm

      @rick it works with text file also

      I want to ask here that can we pass the key automatically from shell script??

      Reply
      • Gayan on August 19, 2015 6:50 pm

        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

        Reply
    Leave A Reply Cancel Reply

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

    Latest Posts

    Transforming Geek Culture with Advanced Software Development

    April 8, 2024

    The Role of Technology in Enhancing Digital Signage Solutions

    February 21, 2024

    How to Check Linux CPU Usage?

    February 5, 2024

    Linux export Command: A Comprehensive Tutorial

    February 3, 2024

    [Fixed] HDMI No Signal to TV or Monitor on Windows 10/11

    November 7, 2023

    AlmaLinux vs Ubuntu – How to Select the Best One?

    October 22, 2023

    Subscribe to Updates

    Get the latest news and updates from Hectic Geek. We won't overload you or sell your data!

    Contact
    • About Us
    • Contact Us
    • Privacy Policy
    • Write for Us
    X (Twitter)
    © 2026 Hectic Geek.

    Type above and press Enter to search. Press Esc to cancel.