D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Symmetric encryption - gpg

 

On 23/11/12 12:23, Neil Winchurst wrote:
This may interest some of the list members.

Nasty things can happen to a computer, eg fire, flood, theft, hard disk failure. I do backup my home folder files, don't we all? But there are just one or two files that I would be very upset to lose. However they are private and personal, mostly financial, and I don't want anyone else to be able to read them.

To this end I use one of the less well known facilities in gnupg: symmetric encryption. This enables me to encrypt a file without worrying about keys and all that stuff. I use a terminal screen for this. Open it up and cd to the relevant folder.

Let's use secret.txt as a sample file. It is as simple as this:-

gpg -c secret.txt

You will be asked for a password, twice. This is to check that they match. The -c option means symmetric encryption. A new file will appear, secret.txt.gpg. The original file will still be there.

This new file will be a binary encrypted file. If you want to have a text encrypted file use the --armor option

gpg --armor -c secret.txt

The new file will be secret.txt.asc

Decryption is also simple.

gpg secret.txt.gpg or gpg secret.txt.asc

No I did not forget an option, it will be recognised as an encrypted file and set up for decryption. You will be asked for the password. If the original file is still there you will be asked if you want to overwrite it. If you want to decrypt to a new file name then go

gpg -o result.txt secret.txt.gpg

Note the order, output file first and then the file to decrypt. Now the decrypted file will be called result.txt.

I have been using Linux for many years now, but did not know about symmetric encryption until last year.

If everyone on the list knows all of this then I apologise for wasting their time.

Regards

Neil


Hi Neil et al

Co-incidentally, I came across the following site with simple instructions on a similar/same topic.

http://www.thegeekstuff.com/2012/10/gnupg-basics/

Part of a series on cryptography apparently, which I will probably have a look through. But not right now.... Dashing off to work..! lol

Cheers roly :-)

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq