Essayer d'importer la clé publique OpenPGP d'un ami - mais rien ne se passe et je ne peux pas voir la clé


2

Problème étrange: un de mes amis m'a envoyé sa clé publique OpenPGP.

J'ai essayé ce qui suit:

Méthode 1

  • Collé son bloc de clé OpenPGP dans un fichier .txt
  • Lancement de Seahorse et cliqué sur Fichier> Importer
  • A sélectionné le fichier .txt
  • Cliquez sur importer
  • Rien ne se passe, aucun message d'erreur, aucun commentaire et ne peut pas voir la clé sous les clés PGP dans l'hippocampe

Méthode 2

Dans le terminal, j'exécute ce qui suit:

sudo gpg --import key.txt

Aucun message d'erreur.Mais je ne vois toujours la clé nulle part.

Lorsque j'essaye de décrypter l'e-mail de test que mon ami m'a envoyé en utilisant Enigmail dans Thunderbird, je suis informé qu'aucune clé correspondante n'a pu être trouvée.

J'utilise Ubuntu 14.04 LTS.

Tous les conseils seraient grandement appréciés.

Mise à jour:

:public key packet:
    version 4, algo 1, created 1341176567, expires 0
    pkey[0]: [2048 bits]
    pkey[1]: [17 bits]
    keyid: 92729696A35FA089
:user ID packet: "John Do <[email protected]>"
:signature packet: algo 1, keyid 93729646B35FA089
    version 4, created 1341176567, md5len 0, sigclass 0x13
    digest algo 2, begin of digest 49 e6
    hashed subpkt 2 len 4 (sig created 2012-07-01)
    hashed subpkt 27 len 1 (key flags: 03)
    hashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)
    hashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)
    hashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)
    hashed subpkt 30 len 1 (features: 01)
    hashed subpkt 23 len 1 (key server preferences: 80)
    subpkt 16 len 8 (issuer key ID 93729646B35FA089)
    data: [2047 bits]
:public sub key packet:
    version 4, algo 1, created 1341176567, expires 0
    pkey[0]: [2048 bits]
    pkey[1]: [17 bits]
    keyid: 91C2606F92AC4FBA
:signature packet: algo 1, keyid 93729646B35FA089
    version 4, created 1341176567, md5len 0, sigclass 0x18
    digest algo 2, begin of digest 36 aa
    hashed subpkt 2 len 4 (sig created 2012-07-01)
    hashed subpkt 27 len 1 (key flags: 0C)
    subpkt 16 len 8 (issuer key ID 93729646B35FA089)
    data: [2047 bits]
0

You have to use sudo try this in the terminal:

  wget -o- (path and key.txt | sudo apt-add key (gpg)

and it might work fine this way.


3

Importing keys

The key you want to import is a normal public OpenPGP key, nothing special, so there should not be any problems.

I guess you ran into two different issues.

  1. Using the Seahorse GUI

    For importing a key, you did everything right. But by default, Seahorse only shows your own keys (i.e. those, for which you have the private key). Click "View" and "Show any" to see the public key.

  2. Using the command line

    sudo gpg --import <file will import into root's GnuPG keyring, which is probably not want to you want to achieve. Import to your user's keyring instead by omitting sudo:

    gpg --import key.txt
    

    Afterwards, it should be visible running

    gpg --list-keys

    Very likely you already imported it successfully, anyway.

Private and Public Keys

Another issue you have seems to be the understanding of public/private key cryptography. With the key listed above, you will not be able to decrypt mail, you need the private key to decrypt a message. Public keys can only be used to encrypt messages to others (and verify the other's signatures), but not decrypting messages encrypted using that public key.

If you want to exchange messages with a friend using OpenPGP (or public/private key cryptography in general, eg. using S/MIME), each of you should generate his own key pair. Now exchange the public keys. If you want to send a message to your friend, use his public key to encrypt the message, now he will be able to decrypt it using his private key. The same applies the other way round.