The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to use PGP File Encryption sandeepb Security 2 10-04-2007 09:47 AM
PGP encryption/decryption solaris 9 frustrated1 SUN Solaris 0 09-30-2006 07:45 PM
File encryption/Key encryption ???? hugow UNIX for Dummies Questions & Answers 1 03-18-2006 04:29 PM
Password encryption/decryption in flat-text files domivv High Level Programming 2 03-04-2005 10:38 AM
encryption of text file for ftp dchalavadi UNIX for Advanced & Expert Users 3 05-16-2002 11:09 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-27-2002
abidmalik abidmalik is offline
Registered User
  
 

Join Date: Aug 2002
Location: North Carolina, USA
Posts: 25
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
  #2 (permalink)  
Old 08-27-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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 (permalink)  
Old 08-27-2002
Kelam_Magnus's Avatar
Kelam_Magnus Kelam_Magnus is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
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.
  #4 (permalink)  
Old 08-27-2002
abidmalik abidmalik is offline
Registered User
  
 

Join Date: Aug 2002
Location: North Carolina, USA
Posts: 25
Wink

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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0