知乎專欄 | 多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者” |
下載PGP: http://www.pgp.com/
下載OpenPGP: http://www.pgpi.org/
GnuPG
~/.gnupg/gpg.conf – 配置檔案 ~/.gnupg/trustdb.gpg – 信任庫 ~/.gnupg/pubring.gpg – 公鑰庫 ~/.gnupg/secring.gpg – 私鑰庫
neo@neo-laptop:~$ gpg --gen-key gpg (GnuPG) 1.4.11; Copyright (C) 2010 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 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) 1y Key expires at Tuesday, October 22, 2013 PM03:25:35 HKT Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" Real name: Neo Chan Email address: 324@example.com Comment: Office Email You selected this USER-ID: "Neo Chan (Office Email) <324@example.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O You need a Passphrase to protect your secret key. 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. Not enough random bytes available. Please do some other work to give the OS a chance to collect more entropy! (Need 282 more bytes) .......+++++ .......+++++ 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: key CEF09301 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u gpg: next trustdb check due at 2013-10-22 pub 2048R/CEF09301 2012-10-22 [expires: 2013-10-22] Key fingerprint = C5B7 50EF 762F 3F7F 1AE5 8AEC AF10 D50D CEF0 9301 uid Neo Chan (Office Email) <324@example.com> sub 2048R/0BF4D523 2012-10-22 [expires: 2013-10-22]
$ gpg --list-keys /home/neo/.gnupg/pubring.gpg ---------------------------- pub 1024R/63268A35 2013-09-11 uid Neo Chen (netkiller) <netkiller@msn.com> sub 1024R/F4F946F9 2013-09-11
neo@neo-laptop:~$ gpg --import 409.asc gpg: key 4D3A0803: public key "Phoenix.L <409@example.com>" imported gpg: key CEF09301: "Neo Chan (Office Email) <324@example.com>" not changed gpg: Total number processed: 2 gpg: imported: 1 (RSA: 1) gpg: unchanged: 1