tomo.gif (1144 ツバツイツト)line.gif (927 ツバツイツト)To previous pageTo home pageMailing to me

PGP(2.6.3i)を使えるようにする

Modified: 3 Apr 2000


PGPのダウンロードとインストール
PGPキーの作成 (自分用の公開鍵と秘密鍵の作成)

環境変数の確認

メールに署名してみる
メールを暗号化してみる
メールを暗号化し署名してみる

PGPの小技


 PGPの小技

公開鍵をテキスト形式で取り出す

D:\PGP> pgp   -kxa  tomoac@csc.ne.jp  tomo

上記コマンドを実行すると、tomo.asp のファイル名で、以下のようにテキスト形式で書き出されます。

Type Bits/KeyID Date User ID
pub 1024/D2AB8DE1 2000/04/01 tomo yoshikawa <tomoac@csc.ne.jp>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3ia

mQCNAzjmD9wAAAEEAMeWh7WwejzujJAf0hJa5cUExn5wIo/vu7DYNr+UYvBv+QBx
JtvbbvuAPN817IEco5RiZUgkN2bgZw3eValMqxELnpE1UsM55w5Jd+AbD5liCmuF
UE+EZk7WG2f+COJFGOpKAaHU+4RrXMTRkv9quCseBV0KQHim0Nv0H1XSq43hAAUR
tCB0b21vIHlvc2hpa2F3YSA8dG9tb0BsaW50Lm5lLmpwPokAlQMFEDjmD9zb9B9V
0quN4QEBF0oD/0rKLpW0PWxjs1LUqz94/yKQqFtMpAiE/0OXw+iyyXqIInDFAdAG
vzYwBV4Qs1245adE3gxFX2gY7gqedJR1rwdLqsdfkDGS3Du8WAKYtfH/iAb2EwPz
LGm0x6zhXn3lwnsZXgPz4nz7LL+LTa3kd6f5/88GCRXg7FsQMxFa1pwB
=0fSf
-----END PGP PUBLIC KEY BLOCK-----


PGP6.5.1i を使う方法

PGP6.5.1i を使う方法
http://www.biwa.ne.jp/~mkoma/pgp.html

PGP日本語版
http://www3.s-energy.co.jp/%7Ehashiya/pgp/


 環境変数の確認

PATH

PATH に、PGP.exe のフォルダを指定しておくこと。

私は、D:\PGP に、インストールしたので、

PATH = D:\PGP;(登録済みの文字列)

PGPPATH

生成したキーファイルをおいたフォルダを指定します。

私は、D:\PGP に、生成したので、

PGPPATH = D:\PGP


TZ

タイムゾーンを指定します。

TZ = JST-9


 メールに署名してみる

メールを作成する

メールを作成し、「ツール」から「PGP署名」を選択します。

pgp-s1.gif (23264 ツバツイツト)

「ツール」から「PGP署名」を選択すると、以下のダイアログが出ますので、パスフレーズを入れます。

キーを作成するとき、emailアドレスを指定しましたので、「E-mailアドレスを使う」にチェックを入れて、「OK」ボタンを押します。

pgp-s2.gif (6745 ツバツイツト)

「OK」ボタンを押すと、以下のメッセージが出て、

pgp-s3.gif (1647 ツバツイツト)

以下のように署名が付加されます。

pgp-s4.gif (27595 ツバツイツト)


署名の確認

メールに署名して送信した場合、以下のような、メールが届きます。

-----BEGIN PGP SIGNED MESSAGE-----

(((メール本文)))

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv

iQCVAwUBOOX7xOdDrdERaIatAQFtZAP+JqyLziGQgzrTH5tNmQHr102Ki8MHn16x
S9m6WJFipkhubRPpaHC2/ZyRL/wggHFFH0W0lCAUPzxcWnKvR/ysv3ddCQt+Dl+t
zaZCKen73FAFwQQdiYeDJoIiMRGFoMbJNlwgVL2YJsGDH/2+5I7uMedltYgoIVLT
omfKmi7xjKI=
=m5ID
-----END PGP SIGNATURE-----

受け取った人は、お持ちのPGPキーファイルに、私の公開鍵を登録すれば、署名の確認ができます。

が、確認できます。


info.gif (1284 ツバツイツト) 私の公開鍵は、「ここ」をクリックすれば、見ることができます。


 メールを暗号化してみる

メールを作成します

pgp-c1.gif (20850 ツバツイツト)


暗号化処理する

「ツール」から「PGP暗号化」を選択します。

送信先の公開鍵で、暗号化処理が終了すると、以下のダイアログが出ます。

"****** OK! *******" を確認しましょう。

info.gif (1284 ツバツイツト) あらかじめ、送信者の公開鍵を入手して、登録しておかないといけません。

pgp-c2.gif (9436 ツバツイツト)


本文が暗号化された

本文が暗号化され、以下のように、読めなくなります。

受け取り者の、公開鍵で暗号化されていますので、受け取り者の秘密鍵でしか復号できません。

pgp-c3.gif (26751 ツバツイツト)


 メールを暗号化し署名してみる

メールを作成する

pgp-b1.gif (21526 ツバツイツト)


署名と暗号する

「ツール」の「PGP署名暗号化」を選択します。

まず、送信元の秘密鍵で、署名をします。

pgp-b2.gif (6707 ツバツイツト)

暗号化が終わると、送信先の公開鍵で暗号化され、以下のダイアログが出てきます。

pgp-b3.gif (9888 ツバツイツト)


本文が署名され暗号化された

本文が署名され暗号化されますので、以下のように、読めなくなります。

受け取り者の、公開鍵で暗号化されていますので、受け取り者の秘密鍵でしか復号できません。

署名の確認は、差出人の公開鍵で行います。

pgp-b4.gif (30425 ツバツイツト)


 PGPのダウンロードとインストール

PGPのダウンロード

MSDOS版のPGPを入手する。

ftp://ftp.riken.go.jp/pub/security/pgp/pc/msdos/pgp263ix.zip

atten.gif (960 ツバツイツト) MSDOS版ですが、見えないところで、処理エンジンとして実行されますので、Beckeyから使えますし、表示上も、実行上も不都合なことはありません。


PGPの解凍

入手した、pgp263ix.zip を解凍します。

解凍すると、pgp263ii.zip が展開されるので、PGPのフォルダに解凍します。

私は、"D:\PGP"に、解凍しました。


環境変数の登録

Beckey から、PGPが起動できるように、"D:\PGP"を、環境変数、PATH に追加登録します。

以下の手順で、公開鍵と秘密鍵をつくりますが、そのキーファイルを入れたフォルダを、PGPPATH で指定します。

TZ で、JST-9 の指定も必要です。

  • PATH = D:\PGP;.......................
  • PGPPATH = D:\PGP
  • TZ = JST-9


CONFIG.TXT を編集

PGPフォルダ内の、CONFIG.TXT に、CharSet (CharSet = noconv)を追加します。

# Sample config.txt file for PGP 2.6.3i.
#
# Blank lines are ignored, as is anything following a '#'.
# Keywords are not case-sensitive.
# Whatever appears in here can be overridden on the command line,
# by specifying (for example) "+armor=on".

# MyName is substring of default userid for secret key to make signatures.
# If not set, PGP will use the first key on your secret keyring (the last
# key you created) if you don't specify the user with -u
# MyName = "John Q. Public"

# The language we will be using for displaying messages to the user.
#
# Available languages:
# en = English (default)
# es = Spanish, fr = French, de = German, it = Italian,
# sv = Swedish, da = Danish, no = Norwegian, fi = Finnish,
# nl = Dutch, pl = Polish, ru = Russian, el = Greek,
# cz = Czech, ro = Romanian, hu = Hungarian, sr = Serbian,
# br = Brazilian Portuguese, lt = Lithuanian, ja = Japanese
#
# Language modules may be obtained from:
# http://www.ifi.uio.no/pgp/modules.shtml
# ftp://ftp.ifi.uio.no/pub/pgp/lang/
#
# Languages not yet available:
# ar = Arabic, iw = Hebrew, tr = Turkish, lv = Latvian, ko = Korean,
# pt = Portugese, is = Icelandic, zh = Chinese, esp = Esperanto
#
# Most of these codes are the ISO 639-1988 2-letter "Codes for
# Representation of Names of Languages"
#
Language = en

# Character set for displaying messages and for conversion of text files.
# If you set this variable to anything else than latin1, koi8 or noconv,
# PGP will do character set conversions if TextMode = on or if you specify
# the -t option when encrypting or signing a file.
#
# Available character sets:
#
# latin1 - ISO-Latin/1 (ISO 8859/1)
# cp850 - IBM codepage 850 (International)
# cp852 - IBM codepage 852 (Eastern Europe)
# cp860 - IBM codepage 860 (Portuguese)
# cp866 - IBM codepage 866 (Russian)
# alt_codes - Cyrillic (Russian)
# koi8 - Cyrillic (Russian)
# keybcs2 - KEYBCS 2 (Eastern Europe)
# next - NeXTSTEP
# mac - Macintosh
# ascii - 7-bit ASCII
#
# For MSDOS with a standard character set you should use cp850 to get
# correct character translations. Russian character sets for MSDOS are
# usually alt_codes.
#
# Note that noconv, latin1, and koi8 are all treated as equivalent.
# Also note that cp852 and keybcs2 convert to/from latin2 rather that
# latin1.
#
# CharSet = cp850
CharSet = noconv

# TMP is the directory name for PGP scratch files, usually a RAM disk.
# It can be overridden by the environment variable TMP.
# TMP = "e:\"

# Pager is the file viewing program used for viewing messages with -m
# If not set or set to "pgp", a built-in pager will be used. The pager set
# in config.txt will override the environment variable PAGER.
# Pager = "list"

# ArmorLines is the maximum number of lines per packet when creating a
# transport armored file. Set to 0 to disable splitting in parts.
ArmorLines = 0

# The following commented-out settings are *not* the defaults.
# Uncomment (remove the leading "#" character) them to get the
# non-default behaviour indicated.

# Armor = on # Use -a flag for ASCII armor whenever applicable
# TextMode = on # Attempt to use -t option where applicable
# ClearSig = off # Use ASCII armor even for unencrypted signed messages
# KeepBinary = on # Decrypt will not delete intermediate .pgp file
# Verbose = 2 # Verbose diagnostic messages
# Verbose = 0 # Be quiet
# Compress = off # Suppress compression to aid debugging
# ShowPass = on # Echo password when user types it
# Interactive = on # Interactively prompt the user when adding keys (-ka)
# EncryptToSelf = on # Encrypt all messages with your own public key
# AutoSign = off # Don't sign new userids
# Legal_Kludge = off # Use backwards-compatible format

# BakRing is the path to a backup copy of your secret keyring, usually
# on floppy disk. Your secret keys will be compared with the backup copy
# when doing a keyring check (pgp -kc)
# BakRing = "a:\secring.pgp"

# Number of completely trusted signatures needed to make a key valid.
Completes_Needed = 1

# Number of marginally trusted signatures needed to make a key valid.
Marginals_Needed = 2

# How many levels of introducers may introduce other introducers.
Cert_Depth = 4

# TZFix is hours to add to time() to get GMT, for GMT timestamps.
# Since MSDOS assumes local time is US Pacific time, and pre-corrects
# Pacific time to GMT, make TZFix=0 for California, -1 for Colorado,
# -2 for Chicago, -3 for NY, -8 for London, -9 for Amsterdam.
# However, if your MSDOS environmental variable TZ is properly defined
# for your timezone, you can leave TZFix=0. Unix systems probably
# shouldn't need to worry about setting TZFix.
# TZFix = 0

# Paths to keyrings and seed file for random generator.
# PubRing = "a:\pubring.pgp"
# SecRing = "a:\secring.pgp"
# RandSeed = "a:\randseed.bin"

# Add optional comment to ASCII armor output.
# Comment = "Requires PGP version 2.6 or later."


myopinion.gif (1016 ツバツイツト) 以上で、準備終了です。引き続いて、PGPキーの作成をします。


 PGPキーの作成

myopinion.gif (1016 ツバツイツト) PGPキーの作成とは、公開鍵と秘密鍵という2つの鍵(キー)を作成します。


PGPキーの作成

Windows2000のコマンドプロンプトを開いて、以下のように実行します。

環境変数(TZ)を設定する

D:\PGP> set TZ=JST-9
D:\PGP>

PGPを実行する

D:\PGP> set TZ=JST-9
D:\PGP> pgp -kg

PGPが実行されると、以下の画面になります。

pgp1.gif (15953 ツバツイツト)

最初は、RSAのキーのサイズを聞いてきます。

"3"の 「1024 bits- "Military" grade, slow, highest security」 を選択します。

次に、UserID を、「名前 <emailアドレス>」の形で入力します。

パスフレーズを2回入力します。長いほうが解読しにくい暗号となります。

パスフレーズとは、要するにパスワードです。ながーーいパスワードを入れるべきであるという意味で、パスフレーズという言い方をします。

Pretty Good Privacy(tm) 2.6.3ia - Public-key encryption for the masses.
(c) 1990-96 Philip Zimmermann, Phil's Pretty Good Software. 1996-03-04
International version - not for use in the USA. Does not use RSAREF.
Current time: 2000/04/01 11:29 GMT

Pick your RSA key size:
1) 512 bits- Low commercial grade, fast but less secure
2) 768 bits- High commercial grade, medium speed, good security
3) 1024 bits- "Military" grade, slow, highest security
Choose 1, 2, or 3, or enter desired number of bits:
3

Generating an RSA key with a 1024-bit modulus.

You need a user ID for your public key. The desired form for this
user ID is your name, followed by your E-mail address enclosed in
<angle brackets>, if you have an E-mail address.
For example: John Q. Smith <12345.6789@compuserve.com>
Enter a user ID for your public key:
tomo yoshikawa <tomoac@csc.ne.jp>

You need a pass phrase to protect your RSA secret key.
Your pass phrase can be any sentence or phrase and may have many
words, spaces, punctuation, or any other printable characters.

Enter pass phrase:
**************
Enter same pass phrase again:
**************
Note that key generation is a lengthy process.

We need to generate 784 random bits. This is done by measuring the
time intervals between your keystrokes. Please enter some random text
on your keyboard until you hear the beep:
784

「784」の乱数を要求します。キーボードを乱打すると、数値が減っていきますから、0になるまで乱打します。

0になると、以下のようなメッセージが出て、キーの生成が終了します。

0 * -Enough, thank you.
..............................**** ................****
Pass phrase is good. Just a moment....
Key signature certificate added.
Key generation completed.

D:\PGP>


PGPキーを見てみる

PGPフォルダに、秘密鍵は、"secring.pgp" の名前。公開鍵は、"pubring.pgp" のファイル名でできています。


To previous pageTo home pageMailing to meJump to Top of pagetomo.gif (1144 ツバツイツト)