Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help Please: Trouble with vi

0 views
Skip to first unread message

Jeffrey Silverman

unread,
Jul 10, 1998, 3:00:00 AM7/10/98
to
Hi, UNIX gurus, here's a scenario+question:
An administrative assistant in my office was preparing a large
document using vi text editor. She saved the file, then spellchecked
using a local command that invokes some UNIX shell commands. (I don't
know the exact structure of our "spellchk" command, but i don't think it's
important.) Next thing she knew, the file had become garbled.
The Senior Systemsa analyst (and incidentally, my boss) says that
this has happened in the past in vi, with slightly different extenuating
circumstances (e.g. spellchk wasn't used).
Q's: is there a way to encript a file in vi?
how is this done (what keystrokes)?
how is this unencripted/decoded?
The thing we think happened is that our admin. assst. accidentally
encripted the file.

Thank you for help/insight into this problem!

=========================================
| Jeffrey D. Silverman |
| User Support Specialist |
| Wilmer Clinical Trials and Biometry |
| Johns Hopkins University |
| Baltimore, MD |
=========================================

P.S./epilogue: The file had been backed up the night before. No serious
work was lost. (in case anyone wondered/cared to find out).

Douglas Wilson

unread,
Jul 12, 1998, 3:00:00 AM7/12/98
to
On Fri, 10 Jul 1998 12:19:38 -0400, Jeffrey Silverman
<je...@welchlink.welch.jhu.edu> wrote:

> Q's: is there a way to encript a file in vi?

Yes, with some vi's; check your man pages.


> how is this done (what keystrokes)?

man vi
> how is this unencripted/decoded?
man vi


Giorgos Keramidas

unread,
Jul 12, 1998, 3:00:00 AM7/12/98
to
Douglas Wilson wrote:
>
> On Fri, 10 Jul 1998 12:19:38 -0400, Jeffrey Silverman
> <je...@welchlink.welch.jhu.edu> wrote:
>
> > Q's: is there a way to encript a file in vi?
> Yes, with some vi's; check your man pages.

Some vi's support the -x option on the command line, and they
will then encrypt/decrypt the file being edited with a password
they will prompt you to give.

This is very dependent, though, on the specific VI
implementation, and is not true for all the vi's out there.

The VI of SunOS 4.3 for instance supported this...
The VIM of Linux doesn't support it yet (at version 4.x which
I have installed on my Linux box at home--dunno about newer
versions, have to check it out).

> > how is this done (what keystrokes)?
> man vi

This is done transparently when you load and save the file.
CAREFUL THOUGH... while you are editing the file, it's
unencrypted contents might be in /tmp somewhere !!!

> > how is this unencripted/decoded?
> man vi

Using the crypt() library function, on every line of input,
as far as I remember from some old SunOS manuals...
This is truly very implementation dependent, however, as it
has been pointed out previously...

The bottom line is:

Why would you like VI to en/decrypt the files on-the-fly?
Isn't it better to have some external program, such as PGP
for the encryption? Just a tought...

Rich Kus

unread,
Jul 12, 1998, 3:00:00 AM7/12/98
to
In article <35A8CAEE...@ceid.upatras.gr>,

From the orginial question in comp.misc somebody was editing
a file when exiting they typed :X instead of :x.

I tried to explain that if they use command vi -x <file> and
type the same keystokes after :X. They may be able to retrieve
a clear file which they must save as new filename.

I problably didn't make clear is that keys stokes after :X in
the orginal file was taken as the password. Since the person
editing the file was going to run a spell checker that could
be the password.


richk


0 new messages