how can i encrypit the text file and how to decrypit it

can any one tell me how can i encrypit the text file how to decrypit that file in linux box using commands
srinut31Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
If you only need to mask it from casual browsing you might encrypt and decrypt with
tr A-Za-z N-ZA-Mn-za-m
If you want more security you might use something like this
http://www.gnupg.org/documentation/manuals/gnupg/Invoking-symcryptrun.html#Invoking-symcryptrun
0
TolomirAdministratorCommented:
Hi,

you can use the free gpg with these commands.

http://lists.gnupg.org/pipermail/gnupg-users/2004-September/023255.html

"man gpg":

    -c, --symmetric
              Encrypt  with  a  symmetric   cipher   using   a
              passphrase.   The  default symmetric cipher used
              is CAST5, but may be chosen with  the  --cipher-
              algo option.


So the solution is:

        (encrypt)       gpg -c file
        (decrypt)       gpg file.gpg

GPG is available for all linux versions.

http://www.gnupg.org/download/supported_systems.en.html

Tolomir
0
srinut31Author Commented:
Thanks for your replay can give me example in redhat linux how can i do encrypition and decrypiton
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

TolomirAdministratorCommented:
first check if gpg is installed.

a simple

# gpg (aka type "gpg" on the bash shell)

should give you the "response"

gpg: Go ahead and type your message ...


---

Then you can encrypt a file here "treesize-0.53.tar" with

 # gpg -c treesize-0.53.tar
Enter passphrase:xxx
Repeat passphrase:xxx

As result you get: treesize-0.53.tar.gpg

---

That's all.

Decryption


# gpg treesize-0.53.tar.gpg
gpg: CAST5 encrypted data
Enter passphrase:xxx
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
gpg: WARNING: message was not integrity protected

---
Now the file is (again) decrypted.

Tolomir



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
srinut31Author Commented:
is it possible to take a backup to using gpg command
0
srinut31Author Commented:
i need to encrypit contant of text file can u help that
0
TolomirAdministratorCommented:
yes you can use tar and then encrypt the file with a gpg key.

0
TolomirAdministratorCommented:
You might be interested in this:

http://ubuntuforums.org/showthread.php?t=535481

HOWTO: Automatic, incremental, encrypted and online stored backup

There are parts you can use to solve you problem.

Just keep in mind that they use a personal (asymetric) encryption key.

Tolomir
0
srinut31Author Commented:
is it possible to use md5 encryption and RSA
0
ozoCommented:
You can use RSA for asymmetric encryption.
MD5 is a one way hash.
0
srinut31Author Commented:
give me some example man for md5 and RSA
0
TolomirAdministratorCommented:
Sorry RSA is not available for gpg:

http://rjmarq.org/pgp/gnupg.html

From the distributed source code, GnuPG does not support the use or creation of RSA keys. However, plugins are available that will allow GnuPG to use (but not create) RSA keys.

---
Srinut31, you could help us a lot if you would describe the entire process you want to accomplish.

From my point I showed you all you need to know to encrypt a textfile.

If you want to backup some textfiles on a daily basis, encrypt then with an asymmetric key and send them to a backup location - that would be a different matter.

Tolomir
0
Dave HoweSoftware and Hardware EngineerCommented:
md5 isn't an encryption method - probably you are better off using a zipfile program to place the text file in a password protected archive (http://www.7-zip.org/ for that)

you can also encrypt an area of your hard drive, and anything in that area will be automatically encrypted. This comes in multiple flavours - EFS is built into all modern versions of windows, but is automatically "unlocked" when you log onto your pc (so you need to log onto your pc every time, autologin is a bad idea) thus exposing the text file to anyone who has access to your pc when unlocked.

Truecrypt does something similar but has to be manually enabled and disabled when you want to use it - when enabled, an extra drive letter appears on your list of drives which contains your encrypted files - you then use them as normal. When disabled, the drive letter disappears and the files are hidden inside a "container file" on your hard drive. you can use this with all editing or other software, as it looks like a normal drive letter to them, too. Truecrypt is free and available from Http://www.truecrypt.org/
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Encryption

From novice to tech pro — start learning today.