KMail/PGP MIME/fr: Difference between revisions
No edit summary |
(Updating to match new version of source page) |
||
Line 18: | Line 18: | ||
{{Output|1=:pub 1024D/85EEC6A5 2004-03-15 Fajar Priyanto (Knowledge is power! http://linux.arinet.org) sub 1024g/BBBB57F3 2004-03-15}} | {{Output|1=:pub 1024D/85EEC6A5 2004-03-15 Fajar Priyanto (Knowledge is power! http://linux.arinet.org) sub 1024g/BBBB57F3 2004-03-15}} | ||
4. Now, in order to export your public key: | |||
4 | {{Input|1=gpg --armor --output fajar-pub.key --export [email protected]}} | ||
{{Input|1= | |||
A file called '''fajar-pub.key''' will be created in the current directory. This is a copy of your public key. This is also the file that people must import to verify your signed emails. You can publish it in keyservers around the world, or you can send it directly to the people requesting it, or you can place it in your website for others to download. | A file called '''fajar-pub.key''' will be created in the current directory. This is a copy of your public key. This is also the file that people must import to verify your signed emails. You can publish it in keyservers around the world, or you can send it directly to the people requesting it, or you can place it in your website for others to download. | ||
Line 27: | Line 25: | ||
Si vous regardez à l'intérieur du fichier, le contenu ressemblera à ça : | Si vous regardez à l'intérieur du fichier, le contenu ressemblera à ça : | ||
{{Output|1=-- --BEGIN PGP PUBLIC KEY BLOCK-- --<!--}}--> | {{Output|1=-- --BEGIN PGP PUBLIC KEY BLOCK-- --<!--}}--> | ||
mQGiBEBVTw8RBACaYvnDkgqNWyktg3urdE9mrpv63x3Iux2zVkuZk8pIRp5HeR/V | mQGiBEBVTw8RBACaYvnDkgqNWyktg3urdE9mrpv63x3Iux2zVkuZk8pIRp5HeR/V | ||
Line 48: | Line 44: | ||
Finally, it is advisable to generate a revocation certificate and store it in a safe place away from your secret key. In case your secret key gets into the wrong hands, you can revoke it so it can not easily be abused by others. The command to do this is | Finally, it is advisable to generate a revocation certificate and store it in a safe place away from your secret key. In case your secret key gets into the wrong hands, you can revoke it so it can not easily be abused by others. The command to do this is | ||
{{Input|1=$ gpg - | {{Input|1=$ gpg --armor --output revoker.asc --gen-revoke [email protected]}} | ||
Ceci vas créer un fichier texte avec le nom '''revoker.asc''' qui contient le certificat de révocation. | Ceci vas créer un fichier texte avec le nom '''revoker.asc''' qui contient le certificat de révocation. | ||
===Setting up Kmail to sign emails using your gpg key === | ===Setting up Kmail to sign emails using your gpg key === | ||
# Fire up '''Kmail''', and go to <menuchoice>Settings -> Configure KMail -> Identities </menuchoice> | # Fire up '''Kmail''', and go to <menuchoice>Settings -> Configure KMail -> Accounts -> Identities </menuchoice> | ||
# Choose the identity that you are using | # Choose the identity that you are using | ||
# Then click <menuchoice>Modify -> Cryptography -> OpenPGP signing key</menuchoice> | # Then click <menuchoice>Modify -> Cryptography -> OpenPGP signing key</menuchoice> | ||
# It will automatically show your | # It will automatically show your gpg key, that is 'Your Name <[email protected]>'' | ||
# If it will not, click <menuchoice> | # If it will not, click <menuchoice>No key</menuchoice>, and choose your key | ||
# Now, set up '''Kmail''' to automatically sign all emails that you write using your key | # Now, set up '''Kmail''' to automatically sign all emails that you write using your key | ||
# Still in the '''Kmail''' Configure menu, go to <menuchoice>Security -> Composing</menuchoice> | # Still in the Cryptography tab, tick <menuchoice>Automatically sign messages</menuchoice> | ||
# In the '''Kmail''' Configure menu, go to <menuchoice>Security -> Composing</menuchoice> | |||
# Tick mark these: | # Tick mark these: | ||
##Store sent messages encrypted, | ##Store sent messages encrypted, | ||
##Always show the encryption key for approval, | ##Always show the encryption key for approval, | ||
# Exit the configuration menu by clicking <menuchoice>OK</menuchoice>. | # Exit the configuration menu by clicking <menuchoice>OK</menuchoice>. | ||
Line 72: | Line 67: | ||
===Testing Kmail by creating a new message === | ===Testing Kmail by creating a new message === | ||
# You will notice that there is a Sign Message | |||
# You will notice that there is a Sign Message banner. It's already active. | |||
[[File:Kmail_gpg_sign_banner.png|400px|center]] | |||
# Write your message and when you are done, send it. | # Write your message and when you are done, send it. | ||
# '''Kmail''' will ask for you to type the secret passphrase that you made during the ''gpg --gen-key'' step. Type it in, and then '''Kmail''' will show you a confirmation window of the signed message. Click <menuchoice>OK</menuchoice> to send it. | # '''Kmail''' will ask for you to type the secret passphrase that you made during the ''gpg --gen-key'' step. Type it in, and then '''Kmail''' will show you a confirmation window of the signed message. Click <menuchoice>OK</menuchoice> to send it. | ||
Line 87: | Line 86: | ||
* Messages signed by a key already known display correctly in '''KMail''', but new keys were not being imported, and you can't sign messages. The culprit is a missing package. Installing pinentry-qt (you may need pinentry-qt4) appears to solve both problems. | * Messages signed by a key already known display correctly in '''KMail''', but new keys were not being imported, and you can't sign messages. The culprit is a missing package. Installing pinentry-qt (you may need pinentry-qt4) appears to solve both problems. | ||
* '''KMail''' no longer does in-line signatures. | * '''KMail''' no longer does in-line signatures. GnuPG has to be used instead. [[Special:myLanguage/KGpg|KGPG]] is a useful application that helps in the management of signatures, both your own and those collected. | ||
{{Note|1=To be sure the "passphrase agent" (gpg-agent) is enabled, check your ''~/.gnupg/gpg.conf'' and eventually uncomment the line containing "use-agent". <br /> | {{Note|1=To be sure the "passphrase agent" (gpg-agent) is enabled, check your ''~/.gnupg/gpg.conf'' and eventually uncomment the line containing "use-agent". <br /> | ||
In '''KMail's''' <menuchoice>Settings -> Configure KMail -> Security tab -> | In '''KMail's''' <menuchoice>Settings -> Configure KMail -> Security tab -> Miscellaneous</menuchoice>, select <menuchoice>GnuPG Settings</menuchoice>, then <menuchoice>Configure</menuchoice>. On the GPG Agent page, give a path to which logs can be written (<menuchoice>Write server mode logs to FILE</menuchoice>), in case of problems. You can check the log in''' KMail's''' <menuchoice>Tools -> Filter Log Viewer</menuchoice>. It's probably a good idea, too, to increase the cache time - I use 3600. }} | ||
{{Warning|1=The following startup and shutdown scripts may be already in use from your distro, but not written in this path. Do not install these scripts unless you have problems with startup and shutdown}} | {{Warning|1=The following startup and shutdown scripts may be already in use from your distro, but not written in this path. Do not install these scripts unless you have problems with startup and shutdown}} | ||
* If you do not have it already, in ''~/. | * If you do not have it already, in ''~/.config/plasma-workspace'' create a directory called ''env''. In there, create a file called ''gpgagent.sh'' containing | ||
{{Input|1= | {{Input|1= | ||
Line 106: | Line 103: | ||
Save it and make it executable. | Save it and make it executable. | ||
In the same way you would clean up gpg-agent on shutdown, so if you do not have it already, create another directory called ''shutdown'' into ''~/. | In the same way you would clean up gpg-agent on shutdown, so if you do not have it already, create another directory called ''shutdown'' into ''~/.config/plasma-workspace'' and create in it another script file called ''stop_gpgagent.sh'' containing | ||
{{Input|1= | {{Input|1= | ||
Line 115: | Line 112: | ||
Save it and make it executable. | Save it and make it executable. | ||
===Troubleshooting Tips === | ===Troubleshooting Tips === | ||
{{Input|1=ps -edalf {{!}} grep gpg-agent }} va lister toutes les instances de gpg-agent. | {{Input|1=ps -edalf {{!}} grep gpg-agent }} va lister toutes les instances de gpg-agent. | ||
{{Input|1=killall gpg-agent}}stops all instances | {{Input|1=killall gpg-agent}} stops all instances | ||
{{Input|1=eval "$(gpg-agent --daemon)"}}will restart the agent | {{Input|1=eval "$(gpg-agent --daemon)"}} will restart the agent | ||
{{Input|1=gpg-agent status}}should tell you if the agent is running. | {{Input|1=gpg-agent status}} should tell you if the agent is running. | ||
== More Information == | |||
[[Special:myLanguage/KMail/gpg|La page de présentation]] a plus d'astuces. | [[Special:myLanguage/KMail/gpg|La page de présentation]] a plus d'astuces. | ||
Line 132: | Line 128: | ||
[[Category:Office]] | [[Category:Office]] | ||
[[Category:Internet]] | [[Category:Internet]] | ||
[[Category:Privacy]] |
Latest revision as of 12:30, 1 March 2019
Mettre en place la signature des message en utilisant GPG dans KMail
de Fajar Priyanto, 2004
Créer, sauvegarder, et publier votre clé
1. Vous allez avoir besoin d'utiliser le programme gpg. Il est normalement déjà installer par défaut.
2. Créer votre propre clé (taper ça à votre compte utilisateur, et pas root) :
gpg --gen-key
Suivez les instructions, elles sont très claires et faciles.
3. Vérifier que la clé est créée :
gpg --list-key
Vous allez voir quelque chose comme ci-dessous avec vos informations :
:pub 1024D/85EEC6A5 2004-03-15 Fajar Priyanto (Knowledge is power! http://linux.arinet.org) sub 1024g/BBBB57F3 2004-03-15
4. Now, in order to export your public key:
gpg --armor --output fajar-pub.key --export [email protected]
A file called fajar-pub.key will be created in the current directory. This is a copy of your public key. This is also the file that people must import to verify your signed emails. You can publish it in keyservers around the world, or you can send it directly to the people requesting it, or you can place it in your website for others to download.
Si vous regardez à l'intérieur du fichier, le contenu ressemblera à ça :
-- --BEGIN PGP PUBLIC KEY BLOCK-- -- mQGiBEBVTw8RBACaYvnDkgqNWyktg3urdE9mrpv63x3Iux2zVkuZk8pIRp5HeR/V [snip snip...] B394acuU4FdGN/EynYUAn1aRvNmgs0/IU2MDzYQpbHIaqpkE =B0cy -- --END PGP PUBLIC KEY BLOCK-- --
Also, you might want to back up your secret key to a secure medium (not just one floppy: this will get damaged), you can use the following command:
$ gpg -ao secret.asc --export-secret-keys 85EEC6A5
This will create a textfile containing your secret or private key, with the filename secret.asc. Do not hand it to someone you do not trust 100%. Hide it in a safe place (or better, more than one).
Finally, it is advisable to generate a revocation certificate and store it in a safe place away from your secret key. In case your secret key gets into the wrong hands, you can revoke it so it can not easily be abused by others. The command to do this is
$ gpg --armor --output revoker.asc --gen-revoke [email protected]
Ceci vas créer un fichier texte avec le nom revoker.asc qui contient le certificat de révocation.
Setting up Kmail to sign emails using your gpg key
- Fire up Kmail, and go to
- Choose the identity that you are using
- Then click
- It will automatically show your gpg key, that is 'Your Name <[email protected]>
- If it will not, click , and choose your key
- Now, set up Kmail to automatically sign all emails that you write using your key
- Still in the Cryptography tab, tick
- In the Kmail Configure menu, go to
- Tick mark these:
- Store sent messages encrypted,
- Always show the encryption key for approval,
- Exit the configuration menu by clicking .
Testing Kmail by creating a new message
- You will notice that there is a Sign Message banner. It's already active.
- Write your message and when you are done, send it.
- Kmail will ask for you to type the secret passphrase that you made during the gpg --gen-key step. Type it in, and then Kmail will show you a confirmation window of the signed message. Click to send it.
- If you test it by sending to yourself, you will notice that Kmail displays the message with a GREEN header, with words like this: Message was signed by Fajar Priyanto (Knowledge is power! http://linux.arinet.org) (Key ID: 0x85EEC6A5). The signature is valid and the key is ultimately trusted.
- People that have your public key will have that display also, but those who don't have the key, will have the message displayed in yellow with words like this: Message was signed with unknown key 0xBFE7357F. The validity of the signature cannot be verified.
FÉLICITATIONS
You now can communicate in a more secure way if you want to. I know this how-to is very short and might not be very clear. Well, please give me suggestions and I will improve it when the time comes. Also I intend to write the second part of this topic which covers how to ENCRYPT messages, import other public keys, and install Crypto Plug-ins. Special thanks to Tim Sawchuck and Philip Cronje and all my friends in the Mandrake List.
Problèmes
- Messages signed by a key already known display correctly in KMail, but new keys were not being imported, and you can't sign messages. The culprit is a missing package. Installing pinentry-qt (you may need pinentry-qt4) appears to solve both problems.
- KMail no longer does in-line signatures. GnuPG has to be used instead. KGPG is a useful application that helps in the management of signatures, both your own and those collected.
- If you do not have it already, in ~/.config/plasma-workspace create a directory called env. In there, create a file called gpgagent.sh containing
#!/bin/bash killall gpg-agent eval `gpg-agent --daemon`
Save it and make it executable.
In the same way you would clean up gpg-agent on shutdown, so if you do not have it already, create another directory called shutdown into ~/.config/plasma-workspace and create in it another script file called stop_gpgagent.sh containing
#!/bin/bash killall gpg-agent
Save it and make it executable.
Troubleshooting Tips
ps -edalf | grep gpg-agent
va lister toutes les instances de gpg-agent.
killall gpg-agent
stops all instances
eval "$(gpg-agent --daemon)"
will restart the agent
gpg-agent status
should tell you if the agent is running.
More Information
La page de présentation a plus d'astuces.