Register
It is currently Thu Aug 21, 2014 4:09 am

gpg usage script (snippet)


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Tue May 17, 2005 8:08 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
i think this is my favorite function so far...
you pass it the name of a file (non-existing) <filename>
then pass it the name of the person you are encrypting for
it then opens a vi session with the name of the file <filename>
once you exit vi, it encrypts whatever was written there and saves <filename>
as a regular file named whatever you named it, and it saves the encrypted version
as <filename>.<person>-encrypted.
Code:
function create_encrypted_ascii_file
{
   file=$1;
   person=$2;
   vi "$file";
   gpg -sea --output "$file.$person-encrypted" --recipient "$person" "$file";
   clear;
   echo ":: Encrypted file created";
   echo ":: File saved as $1.$person-encrypted";
   echo ":: Contents of file shown below";
   echo -e "\n\n";
}


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP