From 4e82f44d66bbbc2f5891dcbc17e272b81079b9cb Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Wed, 21 Sep 2016 06:36:46 +0100 Subject: gpg revision --- tools/conf/etc/skel/.gnupg/gpg.conf | 9 +--- tools/gnupg.html | 105 ++++++++++++++++++------------------ 2 files changed, 56 insertions(+), 58 deletions(-) (limited to 'tools') diff --git a/tools/conf/etc/skel/.gnupg/gpg.conf b/tools/conf/etc/skel/.gnupg/gpg.conf index 20eed65..48edc58 100644 --- a/tools/conf/etc/skel/.gnupg/gpg.conf +++ b/tools/conf/etc/skel/.gnupg/gpg.conf @@ -1,6 +1,3 @@ -# These first three lines are not copied to the gpg.conf file in -# the users home directory. -# $Id$ # Options for GnuPG # Copyright 1998-2003, 2010 Free Software Foundation, Inc. # Copyright 1998-2003, 2010 Werner Koch @@ -85,10 +82,8 @@ # no-include-attributes = do not include attribute IDs (aka "photo IDs") # when sending keys to the keyserver. -keyserver-options auto-key-retrieve -#keyserver wwwkeys.pgp.net -#keyserver search.keyserver.net -keyserver pgp.mit.edu +#keyserver-options auto-key-retrieve + # Uncomment this line to display photo user IDs in key listings and # when a signature from a key with a photo is verified. diff --git a/tools/gnupg.html b/tools/gnupg.html index 61bfaba..f3feed1 100644 --- a/tools/gnupg.html +++ b/tools/gnupg.html @@ -10,6 +10,7 @@

GnuPG

+

1. Install

Install gnupg;

@@ -24,34 +25,7 @@
         $ sudo cp /usr/share/gnupg/gpg-conf.skel /etc/skel/.gnupg/gpg.conf
         
-

Configure GnuPG to automatically fetch public keys, - uncomment following line to ~/.gnupg/gpg.conf;

- -
-        keyserver-options auto-key-retrieve
-        
- -

And add a server, in this example wwwkeys.pgp.net;

- -
-        # keyserver wwwkeys.pgp.net
-        # keyserver search.keyserver.net
-        keyserver pgp.mit.edu
-        
- -

Test your configuration as described by Justin R. Miller Mutt Gnupg Howto;

- -
-        $ gpg --recv-keys 0xC9C40C31
-        
- -

Confirm;

- -
-        gpg --list-keys justin
-        
- -

1. Generate keys

+

2. Generate keys

Options for creating a DSA and ElGamal key;

@@ -83,26 +57,25 @@ (4) RSA (sign only) Your selection? 2 DSA keys may be between 1024 and 3072 bits long. - What keysize do you want? (2048) 2049 - Requested keysize is 2049 bits - rounded up to 2112 bits + What keysize do you want? (2048) 2048 + Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years - Key is valid for? (0) 1y + Key is valid for? (0) 6m Key expires at Tue May 30 20:29:36 2017 WEST Is this correct? (y/N) y GnuPG needs to construct a user ID to identify your key. Real name: User Name - Email address: user@external.org + Email address: user@core.privat-server.net Comment: user at external dot org You selected this USER-ID: - "User Name (user at external dot org) <user@external.org>" + "User Name (user at core) <user@core.privat-server.net>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O @@ -123,7 +96,7 @@ /home/droid/.gnupg/pubring.kbx ------------------------------ pub dsa3072/EE29B7D3 2016-05-30 [SC] [expires: 2017-05-30] - uid [ultimate] User Name (user at external dot org) <user@external.org> + uid [ultimate] User Name (user at core ) <user@core.privat-server.net> sub elg2112/9BC2DC12 2016-05-30 [E] [expires: 2017-05-30] @@ -133,7 +106,7 @@ export GPGKEY=0xEE29B7D3 -

2. Key Management

+

3. Key Management

Key Management;

@@ -146,7 +119,7 @@ $ gpg --edit-key UID -

2.1 Edit key

+

3.1 Edit key

         $ gpg --edit-key KEYID
@@ -162,9 +135,9 @@
         save
         
-

3. Export and import keys

+

4. Export and import keys

-

3.1. Export Key

+

4.1. Export Key

Public keys can be exported in binary format or ASCII-armored format. To export binary format;

@@ -185,14 +158,14 @@

3.2. Export to keyserver

-

The primary public key's ID is referenced in the pub +

The primary public key's ID is referenced in the pub line after the key size, for example the key created above, the short key ID is EE29B7D3:

         gpg --keyserver search.keyserver.net --send-key EE29B7D3
         
-

3.3. Import Key

+

4.3. Import Key

Is very easy to import public keys;

@@ -206,9 +179,39 @@ $ gpg --list-keys -

4. Encrypt, decrypt and signing

+

4.4. Key Servers

-

4.1. Encrypt file

+

Configure GnuPG to automatically fetch public keys, + uncomment following line to ~/.gnupg/gpg.conf;

+ +
+        keyserver-options auto-key-retrieve
+        
+ +

And add a server, in this example wwwkeys.pgp.net;

+ +
+        keyserver wwwkeys.pgp.net
+        keyserver search.keyserver.net
+        keyserver pgp.mit.edu
+        
+ +

Test your configuration as described by Justin R. Miller Mutt Gnupg Howto;

+ +
+        $ gpg --recv-keys 0xC9C40C31
+        
+ +

Confirm;

+ +
+        gpg --list-keys justin
+        
+ + +

5. Encrypt, decrypt and signing

+ +

5.1. Encrypt file

To be abble to decrypt the document we need to include public key in the recipient list;

@@ -220,7 +223,7 @@ index.html -

4.2. Decrypt file

+

5.2. Decrypt file

To decrypt the file;

@@ -228,7 +231,7 @@ $ gpg --output index.html --decrypt index.html.gpg -

4.3. Signing a File

+

5.3. Signing a File

A digital signature certifies and timestamps a document. If the document is subsequently modified in any way, @@ -283,12 +286,12 @@ $ gpg --verify index.html.sig - Systools Index -

This is part of the SysDoc Manual. - Copyright (C) 2016 - Silvino Silva. - See the file Gnu Free Documentation License - for copying conditions.

+ Tools Index +

+ This is part of the c9-doc Manual. + Copyright (C) 2016 + c9 team. + See the file Gnu Free Documentation License for copying conditions.

-- cgit 1.4.1-2-gfad0