The ccrypt utility is a security tool that encrypts and decrypts files and streams on demand. It uses the Advanced Encryption Standard (AES), which is considered very secure. For the moment, it's considered to be unbreakable and is a government standard. When you encrypt a file using ccrypt, a password is required. It is best if you continue to use complex passwords for ccrypt encryption because someone might still try.
Using ccrypt is easy enough for encrypting, decrypting, and viewing an encrypted file's contents. I found the rpm on Sourceforge. Be sure to get the 1.11 or later package. Install the ccrypt-1.11 package in the usual way.
$ sudo rpm -i ccrypt-1.11-1.x86_64.rpm
Once installed, you have a few new apps on your system: ccrypt, ccat, ccencrypt, ccdecrypt, and ccguess. The only two actual programs are ccrypt and ccguess. The others are links to ccrypt with their respective options embedded. For example, you can use ccencrypt or ccdecrypt without knowing any ccrypt options for encrypting or decrypting a file. And ccat decrypts and displays the contents of a file without extracting the original file from the encrypted one. The ccguess application can help recover your encryption password if you remember a part of it.
[ Want to learn more about security? Check out the IT security and compliance checklist. ]
ccencrypt
The ccencrypt command encrypts a file using a key (password or passphrase).
$ cat file1.txt
This is a test of the ccrypt utility
$ ccencrypt file1.txt
Enter encryption key:
Enter encryption key: (repeat)
$ ls
file1.txt.cpt
You must enter your encryption key twice to confirm that you know it. Then your file is encrypted and is appended with a .cpt extension. You can copy your encrypted file or move it and it remains encrypted.
cp file1.txt.cpt file2.txt
$ cat file2.txt
?\?mn???&?ꋄ???n????K?B?^+^?Ҧl?EEn??? ?2?u??t?=??=??`ʽ??c
$ file file2.txt
file2.txt: PGP\011Secret Sub-key -
ccdecrypt
Issue the ccdecrypt command to decrypt and extract the original file from the encrypted one.
$ ccdecrypt file2.txt
Enter decryption key:
$ ls
file1.txt.cpt file2.txt
$ cat file2.txt
This is a test of the ccrypt utility
Notice that although file2.txt is a copy of file1.txt.cpt, when decrypted it remains file2.txt and does not revert back to file1.txt.
ccat
The ccat utility is one of my favorites because it allows me to check the encrypted file contents but doesn't extract the contents.
$ ccat file1.txt.cpt
Enter decryption key:
This is a test of the ccrypt utility
$ ls
file1.txt.cpt file2.txt
The encrypted file, file1.txt.cpt, is left encrypted and intact.
ccguess
I like the ccguess command but I also hate it. I like it because it can help recover a forgotten key, but I hate it because it could compromise security in the wrong hands. Here's an example of how it works. When I encrypted file1.txt, I used the key goonygoogoo to protect it. Yes, it's not a great password (key), but it's one I'll remember. But if I forget, I might remember that it has the word 'goo' in it.
ccguess file1.txt.cpt
Enter approximate key: goo
Generating patterns...1..2..3..4..5..sorting...done.
***g*o 818434604
Possible match: oLK@gw (5 changes, found after trying 6313742182 keys)
As you can see, even a relatively simple key couldn't be cracked even with a prompt that contained a good portion of the key. Could this key stand up to a brute force attack? Probably not, so use long, complex keys or key phrases for added protection.
Wrap up
The ccrypt utility "suite" is an excellent tool for encrypting and decrypting your files. Here you got a small sampling of what the utility can do for you. There are many more options, which you can explore with this one, but these are the ones I've used most. You also got a glimpse of the ccguess utility that might come in handy should you ever need it. Let's hope you don't, especially if you don't remember a large portion of the key.
Sull'autore
Ken has used Red Hat Linux since 1996 and has written ebooks, whitepapers, actual books, thousands of exam review questions, and hundreds of articles on open source and other topics. Ken also has 20+ years of experience as an enterprise sysadmin with Unix, Linux, Windows, and Virtualization.
Follow him on Twitter: @kenhess for a continuous feed of Sysadmin topics, film, and random rants.
In the evening after Ken replaces his red hat with his foil hat, he writes and makes films with varying degrees of success and acceptance. He is an award-winning filmmaker who constantly tries to convince everyone of his Renaissance Man status, also with varying degrees of success and acceptance.
Altri risultati simili a questo
Chasing the holy grail: Why Red Hat’s Hummingbird project aims for "near zero" CVEs
Elevate your vulnerabiFrom challenge to champion: Elevate your vulnerability management strategy lity management strategy with Red Hat
Data Security And AI | Compiler
Data Security 101 | Compiler
Ricerca per canale
Automazione
Novità sull'automazione IT di tecnologie, team e ambienti
Intelligenza artificiale
Aggiornamenti sulle piattaforme che consentono alle aziende di eseguire carichi di lavoro IA ovunque
Hybrid cloud open source
Scopri come affrontare il futuro in modo più agile grazie al cloud ibrido
Sicurezza
Le ultime novità sulle nostre soluzioni per ridurre i rischi nelle tecnologie e negli ambienti
Edge computing
Aggiornamenti sulle piattaforme che semplificano l'operatività edge
Infrastruttura
Le ultime novità sulla piattaforma Linux aziendale leader a livello mondiale
Applicazioni
Approfondimenti sulle nostre soluzioni alle sfide applicative più difficili
Virtualizzazione
Il futuro della virtualizzazione negli ambienti aziendali per i carichi di lavoro on premise o nel cloud