[olug] PGP and vi

Eli Criffield eli at criffield.net
Wed Dec 8 05:22:20 UTC 2004


I've been using this script to keep a file full of passwords for a few
years now, its not perfect but it does what i want it to.

Eli

#!/bin/bash

umask 077
FILE=$@
PWD=`pwd`
TMPFILE=/dev/shm/.tmp.gpg.$$
ENCRYPTTO='gpgeli at criffield.net'


if ! [ -a $FILE ] ; then
	touch $FILE
elif ! gpg -o $TMPFILE $FILE ; then 
	echo
	echo GPG Failure Exiting\!
	echo
	exit 2
fi



vi $TMPFILE

shred -uzf $FILE

if ! gpg -o $FILE -r $ENCRYPTTO -e $TMPFILE ; then
	mv $TMPFILE $FILE.GPG_FAILED_UNENCRYPTED
	echo "******************************************************************"
	echo " 		UNECRYPTED DATA LEFT ON FS"
	echo "		$FILE.GPG_FAILED_UNENCRYPTED is still there"
	echo "******************************************************************"
	exit 1
fi	
	
shred -uzf $TMPFILE 
shred -uzf $TMPFILE.swp 2>/dev/null

--end script

On Tue, Dec 07, 2004 at 08:34:13PM -0800, Sean Edwards wrote:
> Reading the vi man page, I see that Vim can connect to
> a vi server remotely.
> 
> Also in the vi man page, see that vi can work with
> encrypted/decrypted text.
> 
> I was wondering if anybody on the list connected the
> dots.
> 
> Thanks for the link, Matt!
> 
> -=Sean Edwards=-
> cybersean3000 at yahoo.com
> 
> --- Matt Payne <matt.payne at gmail.com> wrote:
> 
> > On Tue, 7 Dec 2004 16:40:01 -0600, Matt Payne
> > <matt.payne at gmail.com> wrote:
> > > On Tue, 7 Dec 2004 14:10:48 -0800 (PST), Sean
> > Edwards
> > > <cybersean3000 at yahoo.com> wrote:
> > > > Has anybody used PGP to encrypt plain test
> > documents
> > > > via a Vi/Vim server?
> > > >
> > > > -=Sean Edwards=-
> > > >
> > > 
> > > Sean - I'm not sure what you mean...
> > > 
> > 
> > Oh! This.  Duh.
> > 
> > http://www.upl.cs.wisc.edu/~will/gpg.php
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> OLUG mailing list
> OLUG at olug.org
> http://lists.olug.org/mailman/listinfo/olug



More information about the OLUG mailing list