Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hi I want to know if one can encrypt a file (not a filesystem) on Linux. Can someone tell me how to do so. If the answer is distro specific ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624

    Encyrpting files in Linux


    Hi

    I want to know if one can encrypt a file (not a filesystem) on Linux. Can someone tell me how to do so. If the answer is distro specific then please refer to Gentoo Linux. A web link will be just as good. Thanks for any help in advance.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729

    Smile

    hi apoorv !!

    check this link ....
    http://kfilecoder.sourceforge.net/

    <=== { casper } ===>
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    Thanks that was great but I don't have KDE installed on my box and I don't plan to install it either. Can you suggest me something that would work without any XManager or X in general? I assume it is possible. Thanks again for your time and patience.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729

    Smile

    hi !!

    Works on OS X, Linux, anywhere with OpenSSL installed:

    To encrypt a file:
    $ openssl des3 -salt -in infile.txt -out encryptedfile.txt

    To decrypt the file:
    $ openssl des3 -d -salt -in encryptedfile.txt -out normalfile.txt

    Do not specify the same file as input and output on encryption.. I have noticed weird effects on OS X (it eats the file). Remove the -in * stuff if you want to pipe data into it (e.g. a tarred folder). Omit the -out * stuff if you want it to pipe data out on STDOUT.

    <=== { casper } ===>
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    Thanks man. That really helped a lot.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  6. #6
    Linux Enthusiast KenJackson's Avatar
    Join Date
    Jun 2006
    Location
    Maryland, USA
    Posts
    510

    ccrypt

    I use ccrypt. It's simple and claims to be very secure, using the Rijndael cipher. You encrypt a file with the 'ccencrypt' command and decrypt it with 'ccdecrypt'. If you use emacs, there is a mode that allows you to edit an encrypted file, provided you know the password.

    It also includes the 'ccat' command, which I use frequently on some encrypted files like this:
    $ ccat mysecrets.txt.cpt | grep 'some text'

  7. #7
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    That sounds intersting too, will try that out soon.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

  8. #8
    Linux Newbie
    Join Date
    Jun 2005
    Posts
    123
    Another app is GnuPG which uses public-key cryptography (has no advantages over private-key cryptography if the data isn't being transmitted).

    However, if you're never going to need to transmit this data you may want to use something simpler like ccrypt which I also recommend.

  9. #9
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,288
    Hi.

    On most Linux systems, there is at least bcrypt, possibly others found by using man -k crypt. (On Solaris, I see crypt.)

    I have no idea how all the items mentioned compare with one another -- good topic for a report perhaps ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  10. #10
    Linux Enthusiast apoorv_khurasia's Avatar
    Join Date
    Feb 2005
    Posts
    624
    Quote Originally Posted by drl
    I have no idea how all the items mentioned compare with one another -- good topic for a report perhaps ...
    On that note I will like to say that as far as security is considered it will depend more on the algorithm (assuming the salt is good) one is using (rc5 or des3???) rather than the software being used for the purpose. If user-friednliness is the issue that out of the apps suggested to me by all (see prev. posts on this thread) I would prefer openssl. A simple command to do it all is enough to lure me in.
    "There is no sixth rule"
    --Rob Pike
    Registered Linux User: 400426 home page

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •