Last Updated : 15 May, 2019
Ccrypt is a command line tool for encryption and decryption ofdata. Ccrypt is based on the Rijndael cipher, the same cipher used in the AES standard. On the other hand, in the AES standard, a 128-bit block size is used, whereas ccrypt uses a 256-bit block size. Ccrypt commonly uses the .cpt file extension for encrypted files.
- It is alightweight tool, the installation and use of this tool is pretty easy.
- It is designed to overcome the shortcomings of standard unix crypt utility.
Installation
sudo apt-get install ccrypt // in ubuntu
Ccrypt Manual
- -e, –encrypt :Encrypt. This is the default mode. If filename arguments are given, encrypt the files and append the suffix .cpt to their names. Otherwise, run as a filter.
- -d, –decrypt:Decrypt. If filename arguments are given, decrypt the files and strip the suffix .cpt from the filenames, if present. Otherwise, run as a filter.
- -c, –cat:Decrypt one or more files to standard output. If no filename arguments are given, decrypt as a filter. Implies -l.
- -x, –keychange:Change the key of encrypted data. In this mode, ccrypt prompts for two passwords: the old one and the new one. If filename arguments are given, modify the files. Otherwise, run as a filter.
- -u, –unixcrypt:Simulate the old unix crypt command. Note: the cipher used by unix crypt has been broken and is not secure. Please use this option only to decrypt existing files. If filename arguments are given, decrypt the files to stdout. Otherwise, run as a filter. Note that for the unix crypt format, there is no easy way to detect whether a given key matches or not; thus, for safety, this mode does not overwrite files.
Encrypting files with Ccrypt
In order to encrypt file using this tool, use following syntax:
ccrypt filename
To encrypt a file : impfile
ccrypt impfile
It will prompt for password couple of times, and once done, it will remove your source file and save the file with .cpt extension.
Source file have been removed and only encrypted file is there:
Decrypt file with Ccrypt
Now in order to decrypt an already encrypted file, command syntax is:
ccrypt –d encryptedfilename
So, Decrypt the encrypted file as:
ccrypt –d impfile.cpt
It will ask for password and will decrypt the file.
It is a tiny application, extremely lightweight as it consumes almost no resources with almost no memory footprints. Installation and usage are extremely easy, it’s a must-have app for Linux users.
References:
http://ccrypt.sourceforge.net/ccrypt.html
http://ccrypt.sourceforge.net/
https://en.wikipedia.org/wiki/Ccrypt
http://www.hecticgeek.com/2012/02/ccrypt-file-encryption-ubuntu-linux/
Improve
Please Login to comment...
FAQs
Use the appropriate commands (gpg --encrypt or right-click and select Encrypt) to encrypt the files in linux, and check for the ". gpg" or ". pgp" extension on the encrypted files. When decrypting files, provide the correct passphrase or key to successfully access the original content.
How do I encrypt and decrypt a file in Linux? ›
Use the appropriate commands (gpg --encrypt or right-click and select Encrypt) to encrypt the files in linux, and check for the ". gpg" or ". pgp" extension on the encrypted files. When decrypting files, provide the correct passphrase or key to successfully access the original content.
How to decrypt using ccrypt? ›
Encrypt and Decrypt files with ccrypt
- $ sudo apt-get install ccrypt.
- $ echo "ok" > file.txt.
- $ ccencrypt file.txt Enter encryption key: Enter encryption key: (repeat)
- $ ls file.txt.cpt.
- $ ccdecrypt file.txt.cpt Enter decryption key:
- $ cat file.txt ok.
How does ccrypt work? ›
ccrypt is a utility for the secure encryption and decryption of 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 cypher, the same cipher used in the AES standard.
How do I encrypt and decrypt a file? ›
How to encrypt a file
- Right-click (or press and hold) a file or folder and select Properties.
- Select the Advanced button and select the Encrypt contents to secure data check box.
- Select OK to close the Advanced Attributes window, select Apply, and then select OK.
How do you check if a file is encrypted or not in Linux? ›
Use the getFileInfo() method that returns the file type and flag that indicates if the file is encrypted.
What are the options for ccrypt? ›
Encrypt/Decrypt Files in Linux using Ccrypt
- -e, –encrypt :Encrypt. This is the default mode. ...
- -d, –decrypt: Decrypt. ...
- -c, –cat: Decrypt one or more files to standard output. ...
- -x, –keychange: Change the key of encrypted data. ...
- -u, –unixcrypt: Simulate the old unix crypt command.
Which of the following encryption algorithms does ccrypt use? ›
ccrypt is based on the Rijndael cipher, which is the U.S. government's chosen candidate for the Advanced Encryption Standard (AES, see http://www.nist.gov/aes). This cipher is believed to provide very strong security.
How does decrypt work? ›
Decryption is the process of converting encrypted data back into its original, readable form. When data is encrypted, it is transformed into a coded format called ciphertext. Decryption reverses this process, using a cryptographic key to decode the information, allowing authorized users to access the original content.
How to encrypt files in Linux script? ›
You can save a key to a file by running ./encrypt.sh -g > encryption. key . To encrypt a file use the -e option and specify the {input-file} (file to encrypt) and {output-file} (encrypted file). You can use a -k Key, -p Password, or leave the parameter blank in order to be prompted for a password.
Enter the command ./decrypt_string.sh <encrypted_password> . For <encrypted_password> , use the text that you copied in Step 4. You are prompted for the system passphrase. After you enter the passphrase, your decrypted password appears.
How to encrypt and decrypt files or folders using command prompt? ›
Using Cipher Command for Encryption
- In Command Prompt, navigate to the directory where the files or folders you want to encrypt are located using the 'cd' command.
- Once in the desired directory, enter the following command: 'cipher /e [filename or folder name]'.
- Press Enter to initiate the encryption process.
How to decrypt a file using PGP key in Linux? ›
Decrypting a File
You should have already created a PGP key pair and provided the public key to your trading partner. You will use the private key from that key pair to decrypt incoming files from that same trading partner. Create a new Project and add the PGP Decrypt task to the Project Outline.
What is the best way to encrypt Linux? ›
In Linux environment Linux Unified Key Setup (LUKS) is used for encrypting entire block devices, hard drive, SSDs and even removable storage drives. Full hard drive encryption is possible only during the installation of the Linux operating system. In this case it will encrypt both the swap space and system partitions.
What is the Linux tool to encrypt files? ›
1. Tomb. Tomb is a free and open-source tool for easily encrypting and backing up files on GNU/Linux systems. It consists of a simple shell script that implements standard GNU tools alongside cryptsetup and LUKS (the Linux kernel's cryptographic API).