Modified: 21 September 2002
まず、GnuPG(暗号化プログラム)をインストールします。
GnuPGのダウンロード
以下から、Windows版のGnuPGをダウンロードします。
http://www.pgpi.org/download/gnupg/
2002年9月21日時点で、「gnupg-w32-1.0.6.zip」がダウンロードできました。
GnuPGのインストール
ダウンロードした「gnupg-w32-1.0.6.zip」を解凍し、"gpg.exe"を、Windowsフォルダにコピーします。
Windowsフォルダにコピーするのは、パスが通っているフォルダに置くためです。
GnuPG(暗号化プログラム)で、自分の公開鍵と秘密鍵を作成します。
初期化する
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\tomo>gpg --gen-key
gpg (GnuPG) 1.0.6; Copyright (C) 2001 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
gpg: c:/gnupg: directory created
gpg: c:/lib/gnupg/options.skl: can't open: No such file or directory
gpg: you have to start GnuPG again, so it can read the new options file
C:\Documents and Settings\tomo>最初は、基本設定が行われ、すぐ終了します。
暗号鍵を作成する
再度、同じコマンドを実行し、以下のように設定します。"Real name"と"Email address"アドレスは、自分のものを設定してください。
C:\Documents and Settings\tomo> gpg --gen-key
gpg (GnuPG) 1.0.6; Copyright (C) 2001 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
gpg: c:/gnupg/secring.gpg: keyring created
gpg: c:/gnupg/pubring.gpg: keyring created
Please select what kind of key you want:
(1) DSA and ElGamal (default)
(2) DSA (sign only)
(4) ElGamal (sign and encrypt)
Your selection? 1
DSA keypair will have 1024 bits.
About to generate a new ELG-E keypair.
minimum keysize is 768 bits
default keysize is 1024 bits
highest suggested keysize is 2048 bits
What keysize do you want? (1024) 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
You need a User-ID to identify your key; the software constructs the user id
from Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"
Real name: tomo
Email address: tomoac@csc.ne.jp
Comment:
You selected this USER-ID:
"tomo yoshikawa <tomoac@csc.ne.jp>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.
Enter passphrase: ********
Repeat passphrase: ********
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
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: NOTE: you should run 'diskperf -y' to enable the disk statistics
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
gpg: NOTE: you should run 'diskperf -y' to enable the disk statistics
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.
+++++++++++++++++++++++++++++++++++++++++++++..++++++++++++++++++++++++++++++.++
+++++++++++++++++++++++++++++++++.++++++++++.++++++++++>.+++++..................
.........+++++^^^^^
public and secret key created and signed.
C:\Documents and Settings\tomo>上記コマンドを実行した結果、"c:\gnypg"フォルダに、公開鍵は、"pubring.gpg"。秘密鍵は、"secring.gpg"の名前で作成されます。
公開鍵のテキスト化
以下のコマンドで、公開鍵をテキスト化します。"publickey.txt"に作成されます。
C:\Documents and Settings\tomo>cd \gnupg
C:\gnupg>gpg -a --export tomoac@csc.ne.jp > publickey.txt
C:\gnupg>dir
ドライブ C のボリューム ラベルは SYSTEM です
ボリューム シリアル番号は C4FE-4CF8 です
C:\gnupg のディレクトリ
2002/09/21 17:58 <DIR> .
2002/09/21 17:58 <DIR> ..
2002/09/21 18:01 1,386 publickey.txt
2002/09/21 17:40 0 pubring.bak
2002/09/21 17:45 889 pubring.gpg
2002/09/21 17:45 600 random_seed
2002/09/21 17:45 1,311 secring.gpg
5 個のファイル 4,186 バイト
2 個のディレクトリ 10,484,908,032 バイトの空き領域
C:\gnupg>"publickey.txt"は、以下の内容です。
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.6 (MingW32)
Comment: For info see http://www.gnupg.org
mQGiBD2MMZsRBAC/NnDF0nHtyS4Cw6jR5GRmh4uo8qMOh5fi9f8cxlKSI2Y84Z3p
20b1+lzTxAWvvGfcMw8gpaqeOMdEyE/zUJqGnZQ6JJ70Jp/AUfJ2orLfohnFsiC7
hBasIn1a8MUc1D0elo81jYNH58BGGsc2G5WZfdK0+f61RZfPVFUnnd+zYwCg+BOC
4HM8lsR+EeY1Lsn4+EkQLDsD/RAwDVU2u8ha7zOWeAeLvOaARzp5PIrcbqfmG6oi
jAJjvTof0z1fOLgcYX/viUqClx2flJBcsOh0+9vhfdFU6CZDDyKsp6B6hf+OrQp/
zkYxykpgblJC+FK5hEIRcVPkOMEEXHSeXKUscWmtzBAD3708CbN3bq8uAhqzzaBe
qX2ZA/4xFFrXVBwbLbWevHD5zBeQTlLPBUJ0GQimMRNHoCF9h5G7SotzlSR1Uid2
gT2CnTmF/pQh6lq7ClfSLWvql20avqkNED60ryiPkFDeBAEfXv510Uy1hai3D4Ye
4i8+J9yI6ZTDJmQEXwQj035kDcpy1vlws+JWYV4NdjhpJaLFXbQhdG9tbyB5b3No
aWthd2EgPHRvbW9hY0Bjc2MubmUuanA+iFcEExECABcFAj2MMZsFCwcKAwQDFQMC
AxYCAQIXgAAKCRB+CYMdOCj17HiMAKCLz0Ee+AifEHUTkpASTG5UNYqzsgCg6O4o
Digdg2I14LCRa/XczxGISxq5AQ0EPYwxnRAEANTNxT3EIj1EascqAYlV0eDrPW53
7R5cVblGgRwOsSM4BR+KuAUQSR1XMOPknDz/JTrRDTBs+SMGPoe0ce9NE2kusCZ8
Sn5L9cgf1ACQKhsPvH0hh5c7CoUnECCTwe+65L05a9DqWBfAAIi0U2P3H6QHlEH1
h8qmbnj9tJQyvQ8nAAMHBACi6PFRdQGibilIJXrpcgbqKQADJnQlcx/LOmBOzaCD
GycBo5bDNhuqflLdifDZnzgPgKWBi4J2NYJrxncpQc6qGjmtxkwICxrzFlWoSraJ
YjeJRN4aixMoLXsOzRGRDXCjibRp3sSqJvAdhwEjWbrkQV+ZLEvVHo50rfVuTj4L
DYhGBBgRAgAGBQI9jDGdAAoJEH4Jgx04KPXst9UAoLC/b2MtkKQ+tboYoEKeUDzx
/BE3AKC3VSKURnBD8i9sm7hShRWCyqEN9g==
=S/qc
-----END PGP PUBLIC KEY BLOCK-----
PGPのPlug-inをダウンロード
以下からダウンロードできます。
http://hp.vector.co.jp/authors/VA023900/gpg-pin/
- 利用するだけでソースコードはいらないので、「インストールパッケージ」をダウンロードしました。
2002年9月21日時点で、「BkGnuPG-1.0.2.exe」がダウンロードできました。
リンクが切れていたら、以下から探してください。
http://www2s.biglobe.ne.jp/~messy/becky/b2/tool/index.html
PGPのPlug-inのインストール
ダウンロードしたファイルを実行するとインストールできます。インストールが終了すると、以下のダイアログが出ます。
「はい」ボタンをクリックすると、以下のダイアログが出ますので、「OK」ボタンをクリックして、Beckey!に組み込みを行います。
Beckey!が起動したら組み込み終了です。
メールを作成する
以下のように通常の手順でメールの作成をします。
![]()
暗号化を行うために、送信直前に、暗号化処理をします。
暗号化処理は、「ツール」メニューから「GnuPG暗号化...」をクリックして行います。
![]()
「GnuPG暗号化...」をクリックすると受信者の指定が出てきますので、確認します。
![]()
確認し、「OK」ボタンをクリックします。
![]()
確認し、「OK」ボタンをクリックすると、以下のように、本文は暗号化され、添付ファイルとなりました。
最後に、送信ボタンをクリックして送信します。
![]()
メールを受信します
実は、先のメールは自分に出しましたので、しばらくすると暗号化したメールが受信できます。
受信後、「ツール」メニューから、「GnuPG: 複合化と検証...」をクリックします。すると、以下のダイアログが出ますので、秘密鍵のパスワードを入力します。
![]()
「OK」ボタンで確認します。
![]()
「閉じる」ボタンで閉じると、以下のように内容を読むことができます。
![]()
署名して送信する
通常通りメールを作成します。
![]()
署名するには、「ツール」メニューから「GnuPG: 署名...」をクリックします。
![]()
署名には、秘密鍵を使いますので、パスワードを入れ、「OK」ボタンをクリックします。
![]()
以下のように確認ダイアログが出ますので、確認後、「閉じる」ボタンをクリックします。
![]()
確認画面を閉じると、以下のように署名データが添付されます。
![]()
署名されたメールを確認する
署名されたメールを受信したら、署名を確認するために、「ツール」メニューから「GnuPG: 複合化と検証...」をクリックします。
![]()
すると、以下のように確認することができます。
![]()