#!/bin/bash
# Passphrase encryption program
# Reads input from text editor and encrypts to screen.
clear
echo "       Passphrase Encryption Program";
echo "--------------------------------------------------"; echo "";
which $EDITOR &>/dev/null
    if [ $? != "0" ];
          then
          echo "It appears that you do not have a text editor set in your .bashrc file.";
          echo "What editor would you like to use ? " ;
          read EDITOR ; echo "";
    fi
echo "Enter the name/comment for this message :"
read comment
$EDITOR passphraseencryption
gpg --armor --comment "$comment" --no-options --output passphraseencryption.gpg --symmetric passphraseencryption
shred -u passphraseencryption ; clear
echo "Outputting passphrase encrypted message"; echo "" ; echo "" ;
cat passphraseencryption.gpg ; echo "" ; echo "" ;
shred -u passphraseencryption.gpg ;
exit