linux poison RSS
linux poison Email

Secure Encryption and Decryption of files and streams - ccrypt

ccrypt is a command line utility for encrypting and decrypting files and streams. It was designed as a replacement for the standard Unix crypt utility, which is notorious for using a very weak encryption algorithm. ccrypt is based on the Rijndael cipher, which is the U.S. government's chosen candidate for the Advanced Encryption Standard (AES). This cipher is believed to provide very strong security. A compatibility mode is included for decrypting legacy "unix crypt" files.

Unlike unix crypt, the algorithm provided by ccrypt is not symmetric, i.e., one must specify whether to encrypt or decrypt. The most common way to invoke ccrypt is via the commands ccencrypt and ccdecrypt. There is also a ccat command for decrypting a file directly to the terminal, thus reducing the likelihood of leaving temporary plaintext files around. In addition, there is a compatibility mode for decrypting legacy unix crypt files. An emacs mode is also supplied for editing encrypted text files.

Encryption and decryption depends on a keyword (or key phrase) supplied by the user. By default, the user is prompted to enter a keyword from the terminal. Keywords can consist of any number of characters, and all characters are significant (although ccrypt internally hashes the key to 256 bits). Longer keywords provide better security than short ones, since they are less likely to be discovered by exhaustive search.

ccrypt Installation:
Use a following command to install ccrypt on a Ubuntu Linux system:
apt-get install ccrypt
When ready you can use ccrypt to encrypt any file. Example:

$ ccrypt test.txt
  Enter encryption key:
  Enter encryption key: (repeat)

$ ls test.txt.cpt

In the above example we have encrypted a file to-encrypt.txt. Output of this operation is file to-encrypt.txt.cpt. To decrypt this file we need to use ccdecrypt and encryption key we used to encrypt it:

$ ccdecrypt test.txt.cpt
  Enter decryption key:


Post a Comment

Related Posts with Thumbnails