![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to use PGP File Encryption | sandeepb | Security | 2 | 10-04-2007 06:47 AM |
| PGP encryption/decryption solaris 9 | frustrated1 | SUN Solaris | 0 | 09-30-2006 04:45 PM |
| File encryption/Key encryption ???? | hugow | UNIX for Dummies Questions & Answers | 1 | 03-18-2006 01:29 PM |
| Password encryption/decryption in flat-text files | domivv | High Level Programming | 2 | 03-04-2005 07:38 AM |
| encryption of text file for ftp | dchalavadi | UNIX for Advanced & Expert Users | 3 | 05-16-2002 08:09 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
File Encryption and Decryption in UNIX.
Hello guys !
I have used "crypt <first> second" command to encrypt "first" to "second" file. i have assign a key for that of course. Now when i try to look content of "seocnd" file through "cat second" command, the file is encrypted and cannot be read which is according to plan. But when i decrypt the same file ("crypt <first> second") and gave the same key and try to see contents of file "second", it is still encrypted why ? after decryption, you should not be able to see the contents of file in plain text ? Please help me in this regad. Thanks and Regards Abid Malik |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
To decrypt, the input must the encrypted file. You are just running the encyption step twice.
crypt < plain > encrypted ## encrypt file crypt < encrypted ## view the file |
|
#3
|
||||
|
||||
|
look at your syntax...
Oops! I guess Perderabo was editing when I was!!
Anyway, you have a few issues here. First, you can't use cat. If you want to view an encrypted file, you must use the [b]vi -x <filename> command. Usually the crypted file ends in *.x]/B] Next, when you decrypt the file, you are extracting the file from the encrypted file. I believe that you must give a filename for it to extract to. It appears that you didn't reverse the order of first second to second first when you were decrypting. to encrypt: crypt <file1 >file2.x to decrypt: crypt <file2.x >file1 Of course, you will have to cleanup any unencrypted files that you create or clear the screen to erase what went to std out. This should fix your problem.
__________________
My brain is your brain |
|
#4
|
|||
|
|||
|
Hello there !
First of let me Thank "Kelam_magnus" and "Perderabo" for solving my problem and helping to understand that encryption issue. I got it very well. You both are right. i tried both ways and it did work fine. this is what i did. ----------------- for encryption of "first" to "second"------------ $> crypt <first> second $> enter Key: test $> ----------------- for decryption---------------------------- $> crypt < second $> enter Key: test and it shows me the content of file. then i tried in vi.. Kelam_magnus is right about -x option of vi. it uses for cryption and decryption. vi -x second enter key: test and here is contents of file. one thing i notice that the encryption file donot have to be end with .x or anything. i am not positive but it worked fine without it. Thanks again and see you in my next question. Abid Malik |
|||
| Google The UNIX and Linux Forums |