How to encrypt and decrypt a file

How to encrypt and decrypt a file using unix Command?

Can any one help me?

How secure do you need it to be? Here's a thread about using the crypt command, but the security on that isn't very good; a modern computer can break the cypher if given the time. There are various freeware programs out there that will do a pretty good job of encrypting files. I haven't used any lately but mcrypt and ccrypt both have decent reputations as far as I know. PGP is a well known commercial solution, and there's the GnuPG or OpenPG alternative. http://www.gnupg.org/ Hope this helps.

Hi dere,

There is commad in Unix "crypt"...U can use dis functionality....First of all u ll have to compress the file...

% compress myfile
% ls -l myfile.Z
% dd if=myfile.Z of=myfile.Z.strip bs=3 skip=1
% crypt akey < myfile.Z.strip

For Decryption:
% (compress -cf /dev/null;crypt < myfile.Z.strip) | uncompress -c > myfile

Just check out the above code snippet.....