Published on

Encrypt and Decrypt files with ccrypt


This is a quick post to demonstrate how to encrypt and decrypt files with ccrypt


Ccrypt's description from its project page:

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.



For debian based systems, to install ccrypt:

$ sudo apt-get install ccrypt


To encrypt files, write a file to disk:

$ echo "ok" > file.txt

Then encrypt the file by providing a password:

$ ccencrypt file.txt
Enter encryption key:
Enter encryption key: (repeat)

It encrypts and only the encrypted file can be found:

$ ls

Decrypt the file, by providing your password that you encrypted it with:

$ ccdecrypt file.txt.cpt
Enter decryption key:

View the decrypted file:

$ cat file.txt

Thank You

Thanks for reading, feel free to check out my website, and subscrube to my newsletter or follow me at @ruanbekker on Twitter.

Buy Me A Coffee