home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] safe viewing of encrypted file



John C Nash wrote:
> 
> #!/bin/bash
> # v -- view contents of encrypted text file
> #  first argument is name of file
> # sudo mount -t tmpfs -o size=500k,nr_inodes=200,mode=0700 tmpfs
> /home/john/tspace
> sudo mount -t tmpfs -o size=500k,nr_inodes=200 tmpfs /home/john/tspace
> tpw=`date`  # Use backquote to execute date
> echo "$tpw\n" > tpass
> echo "$tpw\n" >> tpass
> cat tpass | encfs -S ~/tspace/ ~/etspace/
> echo "Destroy this?\n"
> cat tpass
> rm tpass # for security
> cp $1.cpt ~/etspace/$1.cpt
> ccrypt -d ~/etspace/$1.cpt
> less ~/etspace/$1
> echo "Now scrub it\n"
> scrub ~etspace/$1
> echo "and unmount stuff\n"
> mount
> sudo umount ~/etspace
> sudo umount ~/tspace
> echo "DONE\n"
> mount # to check we have got rid of stuff

All of the above could be simplified to the following command line:

ccat $1.cpt |less



-- 
sg