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.
저자 소개
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.
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.