#1 必要な部品を集めよう

このガイドで登場するソフトウェアは自由なソフトウェアライセンスに基づいています。そのようなソフトは完全な透明性があり、誰でもコピーができ、自分だけのバーションを作ることもできます。そういう特徴があるため、フリーソフトウェアライセンスのソフト(短くフリーソフト)は(Windowsのような)プロプライエタリソフト、つまりは売っている会社だけが中身を知っているようなソフトよりよほど監視しにくいのです。詳しくはfsf.orgをご覧ください。

GNU/LinuxのオペレーティングシステムはほとんどにあらかじめGnuPGがインストールされているので、ダウンロードする必要はありません。でもGnuPGを設定する前に、デスクトップ用のメールプログラムをインストールしなければならないのです。うまい具合にほとんどのGnu/LinuxのディストリビューションではフリーソフトのThunderbirdというメールプログラムをインストールできます。ブラウザーを使ってもGmailのようなメールアカウントをアクセスできますが、Thunderbirdを始めとするメールプログラムはブラウザーよりも多機能です。

そういうメールプログラムがもうパソコンにインストールされているなら、1.Bに進んでください。

1.A メールプログラムに自分のメールアカウントを設定する(まだ設定済でない場合)

メールプログラムを起動し、ウィザードの指示に従ってメールアカウントを設定してください。

トラブル・シューティング

ウィザードとは何ですか?
ウィザードとは、パソコンで何かを設定するとかインストールするためのウィンドウが順番に表れるようになっているものす。「次へ」のボタンをクリックして、設定をしていきます。
私のメールプログラムではメールアカウントが見つからない、またはメールがダウンロードされません
インターネットを検索する前に、同じメールプログラムを使っている人に正しい設定方法をたずねることをお勧めします。

Step 1.B Enigmail(エニグメール)プラグインをメールプログラムにインストール

メールプログラムのメニューの中から「アドイン」を選択してください。これはたいてい「ツール」というメニューの下にあります。必要な拡張機能を、左側のマークで選択します。すでにEnigmailが表示されていれば、すぐ次のステップは飛ばしてください。

表示されていなければ、上の検索バーを使って Enigmailを検索して、プラグインをインストールしてください。インストールが完了したら、メールプログラムを再起動してください。

トラブル・シューティング

メニューが見つかりません。
メニューが横棒3本で表示されるメールプログラムもたくさんあります。

#2 自分だけの鍵を作る

GnuPGシステムを使うためには、公開鍵と秘密鍵が必要です。合わせてキーペアといいます。どちらの鍵もランダムに生成された文字や数字の長い並びで、あなた専用のものです。そして公開鍵と秘密鍵とは特別な数学的な関数で関連づけられています。

公開鍵は、キーサーバーというオンラインディレクトリーに保存されていて、誰でも取り出すことができます。この点で普通の金物の鍵とはだいぶ違います。あなたに暗号メールを送ろうとする人は、まず公開鍵をダウンロードし、それとGnuPGを使ってあなたへの電子メールを暗号化し、それから送信します。そういう意味でキーサーバーは電話帳のようなものだと思っていただいてよいでしょう。あなたへ暗号化メールを送ろうとする人は、電話番号を調べる代わりにあなたの公開鍵を調べるわけです。

もう片方の秘密鍵は金物の鍵に近い働きをするので、自分のコンピューターにしっかり保存しておくべきものです。GnuPGと自分だけの秘密鍵を使って、送られてきた暗号化メールを解読できます。

2.A 自分専用のキーペアを作る

電子メールプログラムのメニューでOpenPGP→設定ウィザードを選択してください。ウィザードの始めの方のウィンドウに現れる説明は読まなくてもいいですが、後のウィンドウの説明は重要です。

2番目の「サインする」または「署名する」というウィンドウでは、「いいえ、むしろ宛先別のルールによって署名が必要なメールを作成する」を選択してください。

「キーを作る」という名前のウィンドウになるまでは既定(デフォルト)の設定を選んでください。

「キーを作る」という名前のウィンドウでは、なるべく強いパスワードを入力してください。つまり、長さが12文字以上で、数字や句読点や大文字・小文字のどれもが1個以上は使われるのがよいパスワードです。パスワードは忘れないでください。ここでの努力がみんな無駄になってしまいますから。

次の「キーを作る」というウィンドウでは計算が終わるまでちょっと時間がかかります。計算をしている間は映画を見るとかウェブを見るとか、とにかくパソコンを使うほどキーの生成が速く進みます。

「OpenPGP完成」というウィンドウが現れたら「電子証明書作成」を選択して、パソコン内の確実なフォルダに保存してください。それにはホームに「鍵撤回証明書」といったフォルダを作ってそこへ保存することをおすすめします。電子証明書作成でもっと詳しいことに興味があれば5章を参照してください。ウィザードには鍵撤回証明書を外付けのデバイスに保存するように表示が出されますが、その作業はあとにしましょう。

トラブル・シューティング

OpenPGPメニューが見つかりません。
メニューが横棒3本で表示されメールプログラムもたくさんあります。OpenPGPが「ツール」というメニューの中に入っていることもあります。
ウィザードに「GnuPGが見つからない」と表示されました。
いつもインストールに使うプログラムを起動して、GnuPGを検索して、インストールしてください。インストールしたらOpenPGP→設定ウィザードを選択して、Enigmailの設定ウィザードを再起動してください。

Step 2.b Upload your public key to a keyserver

In your email program's menu, select OpenPGP → Key Management.

Right click on your key and select Upload Public Keys to Keyserver. Use the default keyserver in the popup.

Now someone who wants to send you an encrypted message can download your public key from the Internet. There are multiple keyservers that you can select from the menu when you upload, but they are all copies of each other, so it doesn't matter which one you use. However, it sometimes takes a few hours for them to match each other when a new key is uploaded.

Troubleshooting

The progress bar never finishes
Close the upload popup, make sure you are connected to the Internet, and try again. If that doesn't work, try again, selecting a different keyserver.
My key doesnt appear in the list
Try checking Show Default Keys.

GnuPG, OpenPGP, what?

You're using a program called GnuPG, but the menu in your email program is called OpenPGP. Confusing, right? In general, the terms GnuPG, GPG, GNU Privacy Guard, OpenPGP and PGP are used interchangeably, though they all have slightly different meanings.

#3 Try it out!

Now you'll try a test correspondence with a computer program named Adele, which knows how to use encryption. Except where noted, these are the same steps you'd follow when corresponding with a real, live person.

Step 3.a Send Adele your public key

This is a special step that you won't have to do when corresponding with real people. In your email program's menu, go to OpenPGP → Key Management. You should see your key in the list that pops up. Right click on your key and select Send Public Keys by Email. This will create a new draft message, as if you had just hit the Write button.

Address the message to adele-en@gnupp.de. Put at least one word (whatever you want) in the subject and body of the email, then hit send.

It may take two or three minutes for Adele to respond. In the meantime, you might want to skip ahead and check out the Use it Well section of this guide. Once she's responded, head to the next step. From here on, you'll be doing just the same thing as when corresponding with a real person.

Step 3.b Send a test encrypted email

Write a new email in your email program, addressed to adele-en@gnupp.de. Make the subject "Encryption test" or something similar and write something in the body. Don't send it yet.

Click the icon of the key in the bottom right of the composition window (it should turn yellow). This tells Enigmail to encrypt the email with the key you downloaded in the last step.

Next to the key, you'll notice an icon of a pencil. Clicking this tells Enigmail to add a special, unique signature to your message, generated using your private key. This is a separate feature from encryption, and you don't have to use it for this guide.

Click Send. Enigmail will pop up a window that says "Recipients not valid, not trusted or not found."

To encrypt and email to Adele, you need her public key, and so now you'll have Enigmail download it from a keyserver. Click Download Missing Keys and use the default in the pop-up that asks you to choose a keyserver. Once it finds keys, check the first one (Key ID starting with 9), then select ok. Select ok in the next pop-up.

Now you are back at the "Recipients not valid, not trusted or not found" screen. Select Adele's key from the list and click Ok. If the message doesn't send automatically, you can hit send now.

Troubleshooting

Enigmail can't find Adele's key
Close the pop-ups that have appeared since you clicked. Make sure you are connected to the Internet and try again. If that doesn't work, repeat the process, choosing a different keyserver when it asks you to pick one.

Important: Security tips

Even if you encrypted your email, the subject line is not encrypted, so don't put private information there. The sending and receiving addresses aren't encrypted either, so they could be read by a surveillance system. When you send attachments, Enigmail will give you an option of whether you want to encrypt them.

It's also good practice to click the key icon in your email composition window before you start to write. Otherwise, your email client could save an unencrypted draft on the mail server, potentially exposing it to snooping.

Step 3.c Receive a response

When Adele receives your email, she will use her private key to decrypt it, then fetch your public key from a keyserver and use it to encrypt a response to you.

Since you encrypted this email with Adele's public key, Adele's private key is required to decrypt it. Adele is the only one with her private key, so no one except her — not even you — can decrypt it.

It may take two or three minutes for Adele to respond. In the meantime, you might want to skip ahead and check out the Use it Well section of this guide.

When you receive Adele's email and open it, Enigmail will automatically detect that it is encrypted with your public key, and then it will use your private key to decrypt it.

Notice the bar that Enigmail shows you above the message, with information about the status of Adele's key.

#4 Learn the Web of Trust

Email encryption is a powerful technology, but it has a weakness; it requires a way to verify that a person's public key is actually theirs. Otherwise, there would be no way to stop an attacker from making an email address with your friend's name, creating keys to go with it and impersonating your friend. That's why the free software programmers that developed email encryption created keysigning and the Web of Trust.

When you sign someone's key, you are publicly saying that you trust that it does belong to them and not an impostor. People who use your public key can see the number of signatures it has. Once you've used GnuPG for a long time, you may have hundreds of signatures. The Web of Trust is the constellation of all GnuPG users, connected to each other by chains of trust expressed through signatures, forming a giant network. The more signatures a key has, and the more signatures its signers' keys have, the more trustworthy that key is.

People's public keys are usually identified by their key fingerprint, which is a string of digits like DD878C06E8C2BEDDD4A440D3E573346992AB3FF7 (for Adele's key). You can see the fingerprint for your public key, and other public keys saved on your computer, by going to OpenPGP → Key Management in your email program's menu, then right clicking on the key and choosing Key Properties. It's good practice to share your fingerprint wherever you share your email address, so that so that people can double-check that they have the correct public key when they download yours from a keyserver.

You may also see public keys referred to by their key ID, which is simply the last 8 digits of the fingerprint, like 92AB3FF7 for Adele. The key ID is visible directly from the Key Management Window. This key ID is like a person's first name (it is a useful shorthand but may not be unique to a given key), whereas the fingerprint actually identifies the key uniquely without the possibility of confusion. If you only have the key ID, you can still look up the key (as well as its fingerprint), like you did in Step 3, but if multiple options appear, you'll need the fingerprint of the person to whom are trying to communicate to verify which one to use.

Step 4.a Sign a key

In your email program's menu, go to OpenPGP → Key Management.

Right click on Adele's public key and select Sign Key from the context menu.

In the window that pops up, select "I will not answer" and click OK.

In your email program's menu, go to OpenPGP → Key Management → Keyserver → Upload Public Keys and hit OK.

You've just effectively said "I trust that Adele's public key actually belongs to Adele." This doesn't mean much because Adele isn't a real person, but it's good practice.

Important: check people's identification before signing their keys

Before signing a real person's key, always make sure it actually belongs to them, and that they are who they say they are. Ask them to show you their ID (unless you trust them very highly) and their public key fingerprint -- not just the shorter public key ID, which could refer to another key as well. In Enigmail, answer honestly in the window that pops up and asks "How carefully have you verified that the key you are about to sign actually belongs to the person(s) named above?".

#5 Use it well

Everyone uses GnuPG a little differently, but it's important to follow some basic practices to keep your email secure. Not following them, you risk the privacy of the people you communicate with, as well as your own, and damage the Web of Trust.

When should I encrypt?

The more you can encrypt your messages, the better. If you only encrypt emails occasionally, each encrypted message could raise a red flag for surveillance systems. If all or most of your email is encrypted, people doing surveillance won't know where to start.

That's not to say that only encrypting some of your email isn't helpful -- it's a great start and it makes bulk surveillance more difficult.

Important: Be wary of invalid keys

GnuPG makes email safer, but it's still important to watch out for invalid keys, which might have fallen into the wrong hands. Email encrypted with invalid keys might be readable by surveillance programs.

In your email program, go back to the second email that Adele sent you. Because Adele encrypted it with your public key, it will have a message from OpenPGP at the top, which most likely says "OpenPGP: Part of this message encrypted."

When using GnuPG, make a habit of glancing at that bar. The program will warn you there if you get an email encrypted with a key that can't be trusted.

Copy your revocation certificate to somewhere safe

Remember when you created your keys and saved the revocation certificate that GnuPG made? It's time to copy that certificate onto the safest digital storage that you have -- the ideal thing is a flash drive, disk, or hard drive stored in a safe place in your home.

If your private key ever gets lost or stolen, you'll need this certificate file to let people know that you are no longer using that keypair.

Important: act swiftly if someone gets your private key

If you lose your private key or someone else gets ahold of it (say, by stealing or cracking your computer), it's important to revoke it immediately before someone else uses it to read your encrypted email. This guide doesn't cover how to revoke a key, but you can follow the instructions on the GnuPG site. After you're done revoking, send an email to everyone with whom you usually use your key to make sure they know.