Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-23-2012, 05:27 AM   #1
LQ Newbie
Registered: Nov 2011
Posts: 7
Blog Entries: 1

Rep: Reputation: Disabled
How to encrypt a file


I used crypt command, the meassage is can not encript a file
then I did $ man crypt and it is there as a function
$ cat filename|crypt > filename.cpy --> does this works, I haven't tried.

it looks like crypt command is not working as an old verion of OSS.
Old 12-23-2012, 09:27 AM   #2
Senior Member
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,153

Rep: Reputation: 85
Why not use gpg instead?

$ gpg -c -o output-file input-file
[enter password]

Old 12-23-2012, 09:35 AM   #3
Senior Member
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Perhaps it won't encrypt a text file without a password. Not sure.
Old 12-23-2012, 01:34 PM   #4
Registered: Dec 2012
Posts: 37

Rep: Reputation: Disabled
You want to encrypt a file without a PW?

You often need a key (password) for most encryption methods. Whether they're public or private.
Old 12-23-2012, 02:21 PM   #5
Registered: Aug 2008
Location: Nova Scotia, Canada
Distribution: Slackware, OpenBSD, others periodically
Posts: 512

Rep: Reputation: 139Reputation: 139
crypt is typically used to generate an encrypted (hashed) password, not to do file encryption. As suggested, check into gpg (GnuPG).
Old 12-25-2012, 05:42 AM   #6
LQ Newbie
Registered: Nov 2011
Posts: 7

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
how to encript a file


I'll check gpg and let you know. Thanks
Old 12-25-2012, 09:27 PM   #7
Registered: Dec 2012
Posts: 52

Rep: Reputation: 7
I've used a program called ccrypt( not to be confused with crypt ) to encrypt files. That was then. Today, I use cryptsetup on a usb stick. All I do is insert the usb stick and a dialog box opens and prompts me for the passphrase. Then I just add the files I want to keep secured.

Last edited by codergeek; 12-25-2012 at 09:29 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to encrypt a single file for... ? dedeco Linux - Newbie 7 09-16-2010 02:43 AM
crypt() perl function to encrypt Password in shell scripts or How Encrypt passwords ? balakrishnay Linux - General 13 01-14-2010 10:35 AM
encrypt and decrypt using encrypt(char block[64], int edflag) rockwell_001 Linux - Security 3 08-30-2009 10:16 AM
How to Encrypt file tulsi Linux - Software 7 08-25-2009 07:25 PM
Encrypt/Decrypt file in Linux , How to ? shipon_97 Linux - Newbie 1 09-05-2007 04:35 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:33 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration