[comp.unix.questions] Encryption and editing

baldwin@usna.MIL (LT Justin D. Baldwin <baldwin@usna>) (09/22/89)

Recently someone on this echo was asking about off-site encrypted mail.
This is something I've been trying to do for a couple of weeks--mainly
just to increase my proficiency in things Unix.

I found out early on that xsend, etc. will not send off-site (though my
man page was absent that datum).  So I contrived to use crypt, encrypt
a message in a file, send it, and at the receiving end the recipient
would simply trim off the header and decrypt it (he would, of course, have
the proper key.  Simple, no?

So here's my problem, humbly submitted for the attention of the wizards:
whenever I edit an encrypted file in *any* way, it trashes the info!
I have gone through repeated attempts to do this in various ways--here
is the simplest case I have tried:

I create a file called 'clear', encrypt it with
 
          crypt mykey < clear > secret

then I edit 'secret' with jove.  Originally I tried to trim mail headers,
but now I just enter jove, add one space to the beginning of the file,
immediately delete the space, and exit.  I then execute

          crypt mykey < secret

which, of course, would normally just print out my file in the clear.  In-
stead, I get about half of the information--and that is sometimes corrupted
in small ways.

What's wrong?  The problem does *not* occur (I would be very nonplussed
if it did) when I enter jove and execute without modifying 'secret' in
any way.  I imagine that jove is adding some kind of end-of-file character
in its attempt to write what it thinks is a 'normal' file.  How do I
defeat this?

Oh, by the way:  I am using jove in (Text) mode.  Does that matter?

Thanks in advance--hope I'm not asking *too* stupid a question (wouldn't
be the first time).

jd

perry@ccssrv.UUCP (Perry Hutchison) (09/23/89)

In article <226@usna.MIL> baldwin@cad.usna.mil.UUCP (J. D. Baldwin
<baldwin@usna>) writes:

> Whenever I edit an encrypted file in *any* way, it trashes the info!
> I imagine that jove is adding some kind of end-of-file character ...
> I am using jove in (Text) mode.

My guess is that the editor is removing nulls and perhaps other non-text
characters from the encrypted file, clearing high bits, or something of
the sort.  Using binary mode may help, but the file will still get messed
up in transmission.  Try uuencoding it.  (Of course then the recipient
needs to have uudecode.)