Aquí hay un escenario específico que tengo.
Quiero tener subclaves en mi computadora portátil y almacenar la clave maestra de forma segura.
Así que seguí adelante y creé nuevas claves:
gpg --gen-key
gpg (GnuPG/MacGPG2) 2.0.20; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 8192 bits long.
What keysize do you want? (2048) 1024
Requested keysize is 1024 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) 0
Key does not expire at all
Is this correct? (y/N) y
GnuPG needs to construct a user ID to identify your key.
Real name: John Nash
Email address: [email protected]
Comment:
You selected this USER-ID:
"John Nash <[email protected]>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: key 6750A605 marked as ultimately trusted
public and secret key created and signed.
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 4 signed: 1 trust: 0-, 0q, 0n, 0m, 0f, 4u
gpg: depth: 1 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 1f, 0u
gpg: next trustdb check due at 2015-01-02
pub 1024R/6750A605 2014-09-10
Key fingerprint = BAB9 E8A4 4191 1B99 F8D1 ED09 544A F1E9 6750 A605
uid John Nash <[email protected]>
sub 1024R/68E051E2 2014-09-10
Y como se ve, he creado un conjunto predeterminado de claves que generaron una subclave para el cifrado. Después de crear una nueva clave de firma:
gpg --edit-key jnash
gpg (GnuPG/MacGPG2) 2.0.20; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Secret key is available.
pub 1024R/6750A605 created: 2014-09-10 expires: never usage: SC
trust: ultimate validity: ultimate
sub 1024R/68E051E2 created: 2014-09-10 expires: never usage: E
[ultimate] (1). John Nash <[email protected]>
gpg> addkey
Key is protected.
You need a passphrase to unlock the secret key for
user: "John Nash <[email protected]>"
1024-bit RSA key, ID 6750A605, created 2014-09-10
Please select what kind of key you want:
(3) DSA (sign only)
(4) RSA (sign only)
(5) Elgamal (encrypt only)
(6) RSA (encrypt only)
Your selection? 4
RSA keys may be between 1024 and 8192 bits long.
What keysize do you want? (2048) 1024
Requested keysize is 1024 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) 0
Key does not expire at all
Is this correct? (y/N) y
Really create? (y/N) y
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
pub 1024R/6750A605 created: 2014-09-10 expires: never usage: SC
trust: ultimate validity: ultimate
sub 1024R/68E051E2 created: 2014-09-10 expires: never usage: E
sub 1024R/C1DC3BB6 created: 2014-09-10 expires: never usage: S
[ultimate] (1). John Nash <[email protected]>
Esto me dejó con las siguientes subclaves:
pub 1024R/6750A605 created: 2014-09-10 expires: never usage: SC
trust: ultimate validity: ultimate
sub 1024R/68E051E2 created: 2014-09-10 expires: never usage: E
sub 1024R/C1DC3BB6 created: 2014-09-10 expires: never usage: S
Después de exportar las subclaves y la clave maestra del conjunto de claves:
gpg --export-secret-key jnash --armor > masterkey
gpg --export-secret-subkeys jnash --armor > subkeys
gpg --delete-secret-key jnash
E importó las subclaves solo con gpg --import subkeys
que me dejaron con la siguiente salida al ejecutar gpg -K
sec# 1024R/6750A605 2014-09-10
uid John Nash <[email protected]>
ssb 1024R/68E051E2 2014-09-10
ssb 1024R/C1DC3BB6 2014-09-10
Según tengo entendido, ahora ya no tengo la llave maestra y esta computadora está lista para viajar.
Ahora, digamos que me robaron y mis llaves están comprometidas.
Tendré que revocar 68E051E2
y C1DC3BB6
¿verdad?
Pero después de hacerlo y reemplazarlos por otros nuevos, no podré abrir los elementos antiguos que fueron cifrados y firmados con ambas claves, ¿verdad?
- Descargo de responsabilidad: Los datos de arriba son solo una muestra. Nunca tendría claves con solo 1024 en el tamaño de la clave.