Register
It is currently Tue Oct 21, 2014 7:33 am

Passphrase encryption program


All times are UTC - 6 hours


Post new topic Reply to topic  [ 7 posts ] 
Author Message
 PostPosted: Fri Jan 13, 2006 4:50 pm   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
Code:
#!/bin/bash
# Passphrase encryption program
# Created by Dave Crouse 01-13-2006
# 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


Top
 Profile WWW  
 PostPosted: Sat Jul 22, 2006 10:24 pm   
User avatar

Joined: Tue May 17, 2005 12:55 am
Posts: 86
Location: Big Easy, Louisiana
how would i encrypt a file with a specified passphrase....ie...summer would be the pass phrase, theoretically


Top
 Profile YIM  
 PostPosted: Sun Jul 23, 2006 8:55 pm   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
my passphrase encryption program...
it encrypts any file... and appends the file name with .gpg..
if you named them encrypt_it
you would call it like:
encrypt_it /file/to/encrypt
Code:
#!/bin/bash

gpg --armor --comment "Encrypted by jbsnake" --no-options --output "${1}.gpg" --symmetric "${1}"


my passphrase decryption program...
it decrypts any file... and removes the .gpg at the end of a file name
if you called this one decrypt_it
you would call it like:
decrypt_it /file/to/decrypt.gpg
Code:
#!/bin/bash

gpg --decrypt --output "${1:0:${#1}-4}" "${1}"


obviously there could be more to them... but i just needed something quick and dirty


Top
 Profile  
 PostPosted: Mon Jul 24, 2006 7:54 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 669
Location: Des Moines, Iowa
coastie wrote:
how would i encrypt a file with a specified passphrase....ie...summer would be the pass phrase, theoretically


When using a passphrase vs using keys... it's called --symmetric encryption. I probably should have used the title symmetric encryption, but passphrase made more sense to me at the time :D

So, doing a "man gpg" ..... look for the symmetric option, and it will tell you all about it i'm sure :D :D The man page for gpg is pretty detailed, 1500 + lines on my system..... the most used stuff is right at the top though.

I hadn't thought of a decrypting or encrypting routine for files coastie, that's a great idea :)


Top
 Profile WWW  
 PostPosted: Mon Jul 24, 2006 1:29 pm   
User avatar

Joined: Tue May 17, 2005 12:55 am
Posts: 86
Location: Big Easy, Louisiana
did you get the gift i left for you :? look at my account on your ftp :idea:


Top
 Profile YIM  
 PostPosted: Tue Jul 25, 2006 1:02 pm   
User avatar

Joined: Tue May 17, 2005 12:55 am
Posts: 86
Location: Big Easy, Louisiana
ok i figured out the encryption using a passphrase.

Code:
gpg -c filename.ext


you are then prompted for the passphrase :D


Top
 Profile YIM  
 PostPosted: Tue Jun 05, 2007 4:15 am   

Joined: Wed May 09, 2007 4:07 pm
Posts: 6
coastie wrote:
ok i figured out the encryption using a passphrase.

Code:
gpg -c filename.ext


you are then prompted for the passphrase :D


just to follow-up from this when I decrypt something I get this error after it decrypts...

"gpg: WARNING: message was not integrity protected"


What does this mean?

Also If i encrypt a native file does gpg preserve the files structure and resources?
I'm thinking of a filemaker database file that I want to backup.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 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:  
cron


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