LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-02-2014, 02:15 PM   #1
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Rep: Reputation: 25
Post Configuring GnuPG, need some final thoughts.


Hey, I've decided to start using email encryption, and since I'm on linux this means GnuPG. Before I go live with my setup I'd like to verify that I'm not missing something important or doing something stupid. Now the thing is I've done research, and it's been a long ride, but I am still in the learning phase right now. I came up with the following settings (the key settings will be taken from gnupg.conf - see below). In particular, these two articles were most helpful:

https://we.riseup.net/riseuplabs+pao...best-practices
https://alexcabal.com/creating-the-perfect-gpg-keypair

Key generation procedure:
Quote:
- Boot a recent live linux CD on an unrelated computer

- Create a 4096-bit RSA certification key with unlimited expiry
# gpg --gen-keys
"(4) RSA (sign only)", 4096, no expiry

- Create a 4096-bit encryption subkey with 5 year expiry
# gpg --edit-key <KeyID>
gpg> addkey, "(6) RSA (encrypt only)", 4096, 5y

- Create a 4096-bit signing subkey with 5 year expiry
gpg> addkey, select "(4) RSA (sign only)", 4096, 5y

- Save the master key to a encrypted container on a USB stick
gpg> save
# gpg --export-secret-keys --armor <KeyID> > /mnt/usb/encrypted/key_private.asc
# gpg --export --armor <KeyID> > /mnt/usb/encrypted/key_public.asc

- Generate a revocation key, put it somewhere safe.
# gpg --gen-revoke --output /mnt/usb/encrypted/key_revoke.asc

- Remove the master private key
# gpg --export-secret-subkeys --armor <KeyID> > subkey_private.asc
# gpg --delete-secret-key <KeyID>
# gpg --import subkey_private.asc


- Export the public key, and the private subkeys onto another USB key
# gpg --export --armor <KeyID> > /mnt/usb2/encrypted/key_public.asc
# gpg --export-secret-keys --armor <KeyID> > /mnt/usb2/encrypted/key_private.asc

- Power off the laptop to erase RAM
# poweroff

- Import the laptop key into my laptop's GnuPG keyring for daily use
$ gpg --import /mnt/usb2/encrypted/key_public.asc
$ gpg --import /mnt/usb2/encrypted/key_private.asc

- Upload the public key to a keyserver
$ gpg --send-keys <KeyID>

gnupg.conf:
Quote:
# Keyserver settings
keyserver hkps://hkps.pool.sks-keyservers.net
keyserver-options ca-cert-file=/etc/ca-certificates/sks-keyservers.netCA.pem
keyserver-options no-honor-keyserver-url

# Display options
no-greeting
no-emit-version
fixed-list-mode
keyid-format 0xlong
with-fingerprint
verify-options show-uid-validity
list-options show-uid-validity
sig-notation issuer-fpr@notations.openpgp.fifthhorseman.net=%g

# Ciphers, hashes, stuff
personal-digest-preferences SHA512 SHA384 SHA256 SHA224
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 BZIP2 ZLIB ZIP Uncompressed
cert-digest-algo SHA512

# Misc
use-agent
  • Is everything okay with my OpenPGP key setup procedure? Is everything okay with my gpg.conf? Am I missing anything important?
  • Since I'll be generating a key on a live CD, how does it affect the randomness (/dev/urandom, /dev/random)? Does the system have the same random seed each boot? What can I do to increase randomization i.e. introduce some extra entropy before generating the key? I must not connect to the internet!
  • One of the articles suggest that I use sha512 as the signature digest. But is it really needed? I mean I've read somewhere that 512 is a bit too long, and that it makes it difficult to read emails that are all signed with these long and annoying signatures. It suggests to use sha256 instead.
  • I've noticed that GnuPG also supports Twofish encryption algorithm. The articles do not specifically mention it, but can I add it to my key i.e. in between the AES and CAST5?


Thanks in advance!
 
Old 06-03-2014, 12:16 AM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
Hey, I've decided to start using email encryption,
You'll need at least one other person to go along with that bold move or you'll get awful lonely.
Quote:
or doing something stupid.
I wouldn't say stupid, but if your answer to the above questions is "no", perhaps you haven't thought this all the way through...
 
Old 06-06-2014, 07:30 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
On my systems, GPG encryption and decryption is very-nicely integrated right into the mail client, and there is a "GPG Keychain" utility for conveniently managing all of the keys: generating them, pushing them to keyservers, pulling from keyservers and so-on. When I send a message to certain people, it is automatically encrypted using their key, and the same is true for messages that I receive from them. (If any message weren't properly encrypted, a gigantic red-flag appears or the message is simply refused.)

Encryption of EMail (which can also be done using the S/MIME standard ...) ought to be painless. It needs to be painless, otherwise you just won't do it. It really needs to be just as routine, just as transparent, and just as "thought-less," as typing "https" when visiting a web-site. "It Just Works,™" and yet the message is at-least somewhat more secure than before.

Therefore, look around to see if you have in fact identified "the easiest way to do it." Yes, it is academically interesting and informative to get to know these tools at the command-line level, but in daily practice it should not be necessary or, as I said, you just won't do it or won't do it consistently.
 
Old 06-07-2014, 03:13 AM   #4
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Original Poster
Rep: Reputation: 25
What mail clients do you people use? I only know Thunderbird + Enigmail.
 
Old 06-11-2014, 01:39 AM   #5
orasis
Member
 
Registered: Mar 2008
Distribution: Slackware, Free-BSD
Posts: 53

Rep: Reputation: 34
4096-bit RSA? LOL You must be emailing some pretty classified stuff my man! GPA is a nice little program that makes key management easier.
 
Old 06-12-2014, 01:12 AM   #6
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Original Poster
Rep: Reputation: 25
Personally I would have gone for the ECC equivalents, but those are not very well supported today. Anyway, I found out that mouse movement and heavy disk activity (i.e. running "find") does increase entropy, and thus /dev/random output speed (tested). It's also ok to put twofish into the list of ciphers.
 
Old 06-20-2014, 01:10 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Well, OS/X Mail supports S/MIME natively, and there's a very nice GPG plug-in with an accompanying GUI key-management program So, I can do either form of encryption at will, and verification is automatic. There are certain people with whom all my communications is automatically (and transparently) encrypted and decrypted. Messages which claim to be from a certain person, but who do not bear their signature and/or that are not encrypted (if I have specified that they must be) will be red-flagged or simply discarded.

The KMail client also supports encryption. Even good ol' Microsoft Outlook can do it.

You probably shouldn't have to monkey with the command-line directly, although you certainly can, and you should basically know how. Encryption should be, and can be, easy. So easy that you can almost forget about it.

Last edited by sundialsvcs; 06-20-2014 at 01:12 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: In search of the best OS for a 9-year-old laptop: Part VIII — Final thoughts LXer Syndicated Linux News 0 08-06-2008 03:20 AM
LXer: AntiX spin on Mepis in 'pre-final' stage, should be 'final' in early July LXer Syndicated Linux News 0 06-28-2007 10:31 PM
LXer: Final thoughts on OSCON - with video! LXer Syndicated Linux News 0 08-02-2006 08:21 PM
LXer: MS vs. EC: Final Q& A and final pleadings LXer Syndicated Linux News 0 04-30-2006 03:54 AM
Some thoughts after the final Bush-Kerry debate frankie_DJ General 3 10-17-2004 05:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 03:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration