This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

GnuPG

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page GnuPG and the translation is 88% complete.
Outdated translations are marked like this.
 As of March 3rd, 2015, the information in this article is probably outdated. You can help the Gentoo community by verifying and updating this article.

이 안내서는 젠투 리눅스 사용자에게 보안 통신용 도구인 GnuPG 기본 사용 방법을 알려드립니다.

도입부

이 안내서에서 무얼 배울 수 있을까

This guide assumes the reader is familiar with public-key cryptography, encryption, and digital signatures. If this is not the case take a look at the official GnuPG handbook, specifically the second chapter, and then come back to this article.

독자 여러분은 GnuPG를 설치하고 키 쌍을 만들며 키 모음에 키를 추가한 후 키 서버에 공용키를 제출하는 방법을 배웁니다. 또한 메시지와 파일을 주고 받을 때 서명, 암호화, 검증, 복호화하는 방법도 배웁니다.

설치

USE 플래그

USE flags for app-crypt/gnupg The GNU Privacy Guard, a GPL OpenPGP implementation

bzip2 Enable bzip2 compression support
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
ldap Add LDAP support (Lightweight Directory Access Protocol)
nls Add Native Language Support (using gettext - GNU locale utilities)
readline Enable support for libreadline, a GNU line-editing library that almost everyone wants
selinux  !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
smartcard Build scdaemon software. Enables usage of OpenPGP cards. For other type of smartcards, try app-crypt/gnupg-pkcs11-scd. Bring in dev-libs/libusb as a dependency; enable scdaemon.
ssl Add support for SSL/TLS connections (Secure Socket Layer / Transport Layer Security)
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
tofu Enable support for Trust on First use trust model; requires dev-db/sqlite.
tools Install extra tools (including gpgsplit and gpg-zip).
tpm Enable TPM support via app-crypt/tpm2-tss and build tpm2d.
usb Build direct CCID access for scdaemon; requires dev-libs/libusb.
user-socket try a socket directory which is not removed by init manager at session end
verify-sig Verify upstream signatures on distfiles
wks-server Install the wks-server

Emerge

root #emerge --ask app-crypt/gnupg

다른 프로그램

At the very least, GnuPG must be emerged. Many applications today have some sort of support for PGP, so having crypt as a USE flag is a good idea. When desiring an email client capable of using GnuPG any of the following options are well suited:

사용법

공용 키 모음에 키 만들고 추가하기

키 만들기

To create a key, use the gpg --full-gen-key command. The first time it is run, it will create some directories essential to the correct operation and implementation of GnuPG. Run it again to create the keys:

user $gpg --full-gen-key
gpg (GnuPG) 2.1.18; Copyright (C) 2017 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? 1

사용하려는 키의 형식을 선택할 수 있습니다만, 대부분 사용자는 기본 RSA 와 RSA를 사용합니다. 그 다음은 키 크기 입니다. 크면 클수록 좋지만, DSA/ElGamal 키로는 2048비트 이상 사용할 수 없습니다. 전자메일 통신에서는 보통 2048 비트면 충분합니다.

Gentoo developers (especially those working on ebuilds) are encouraged to use 4096-bit keys.

After size comes the expiration date. Here smaller is better, but users can go for a key that never expires, or for an expiration date of around 2 or 3 years. Remember that you can indefinitely extend the expiry of a key, even after it expired.

코드 Choosing key size
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) 0
Key does not expire at all

이제 키 사용자의 신상 정보를 입력할 때입니다. 다른 사용자에게 공용키를 보낼 때 (가짜가 아닌)실제 전자메일 주소를 넣는게 중요합니다.

코드 사용자 정보 입력
Is this correct (y/n)? y
                          
GnuPG needs to construct a user ID to identify your key.
  
Real name: Larry the cow
Email address: larry@gentoo.org
Comment: Gentoo's own
You selected this USER-ID:
"Larry the cow (Gentoo's own) <larry@gentoo.org>"
  
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O 
You need a Passphrase to protect your secret key.    
  
Enter passphrase:

Now enter a key passphrase twice. It is a good idea to use a strong passphrase. If someone is able to obtain the associated private key and cracks the password they will be able to impersonate the user by sending signed messages just as the user would. The malicious user could dupe the victims contacts into believing the e-mails or messages were sent by the victim. Note: if you have any errors during this process, see the pinentry section below.

그 다음에는, GnuPG가 키를 만듭니다. 마우스를 움직이거나, 웹을 탐색하거나, 백그라운드에서 오디오 스트리밍을 재생하면 이러한 절차를 빨리 진행할 수 있게 하는데 GnuPG에서 키 쌍의 보안성을 증대할 임의 데이터를 만들 때 도움이 되기 때문입니다.

폐기 인증 만들기

중요
이 부분은 굉장히 중요하므로 지금 당장 해야합니다.

키를 만들고 나면 철회 인증서를 만들어야합니다. 이 철회 인증서는 사용자로 하여금 고약한 일을 겪게 될 경우 (악의적인 사용자가 키/암호 제어권을 얻었을 경우) 키를 깰 수 있도록 합니다.

user $gpg --list-keys
/home/humpback/.gnupg/pubring.gpg
---------------------------------
pub  1024D/75447B14 2002-12-08 Larry the cow (Gentoo's own) <larry@gentoo.org>
sub  2048g/96D6CDAD 2002-12-08
user $gpg --output revoke.asc --gen-revoke 75447B14
sec  1024D/75447B14 2002-12-08   Larry the cow (Gentoo's own) <larry@gentoo.org>
  
Create a revocation certificate for this key? y
Please select the reason for the revocation:
  0 = No reason specified
  1 = Key has been compromised
  2 = Key is superseded
  3 = Key is no longer used
  Q = Cancel
(Probably you want to select 1 here)
Your decision? 1
Enter an optional description; end it with an empty line:
> Someone cracked me and got my key and passphrase
>
Reason for revocation: Key has been compromised
Someone cracked me and got my key and passphrase
Is this okay? y
  
You need a passphrase to unlock the secret key for
user: "Larry the cow (Gentoo's own) <larry@gentoo.org>"
1024-bit DSA key, ID 75447B14, created 2002-12-08
  
ASCII armored output forced.
Revocation certificate created.
  
Please move it to a medium which you can hide away; if Mallory gets
access to this certificate he can use it to make your key unusable.
It is smart to print this certificate and store it away, just in case
your media become unreadable.  But have some caution:  The print system of
your machine might store the data and make it available to others!

gpg --list-keys 명령은 공용 키 모음의 키를 보여줍니다. 키 ID를 볼 때 활용하며 철회 인증서를 만들 수 있게 합니다. .gnupg 디렉터리 전체와 철회 인증서(ASCII 내용이 들어간 revoke.asc)를 안전한 매체(안전한 곳에 보관하는 CD-R 또는 USB 장치)에 보관하는게 좋습니다. revoke.asc 파일은 키를 철회하고 나중에 못쓰게 만들때 활용할 수 있음을 기억해두십시오.

참고
이 키를 활용할 전자 메일 주소가 여러개가 있다면 gpg --edit-key <USER_ID> 명령을 실행한 후 adduid 명령을 사용할 수 있습니다. 이름, 전자메일 주소, 사용할 두번째 ID에 대한 설명을 물어봅니다.

키 내보내기

키를 내보내려면 gpg --armor --output larry.asc --export larry@gentoo.org와 같이 입력하십시오. 거의 언제든 키 ID 또는 키를 식별할 만한 문자열(여기서는 이메일 주소를 사용합니다)을 사용할 수 있습니다. Larry는 이제 친구에게 보내거나 웹 페이지에 넣어 다른 사람들이 Larry와 안전하게 통신할 수 있게 하는 larry.asc 파일을 가집니다.

키 가져오기

공용 키 모음에 파일을 추가하려면 다음 단계를 거쳐야합니다:

  1. 먼저 키를 가져온 다음,
  2. 키 지문을 확인해야 합니다.
  3. 지문을 인정한 다음, 검증해야 합니다.
참고
키를 검증할 때 만전을 기해야 합니다. 공용키 암호화에 있어 가장 취약할 때입니다.

이제 Luis Pinto(원 저자의 친구)의 공용키를 공용 키 모음에 추가해보도록 하겠습니다. 친구를 불러 키 지문을 요청한 다음, fpr 명령으로 출력한 지문과 비교하도록 하겠습니다. 키를 확인하고 나면 공용 키 모음에 추가합니다. 이 경우, Luis의 키는 2003년 12월 1일에 무효화되며, 유효기간이 경과하는 날에 키가 필요하면 다시 요청할 것입니다.

user $gpg --import luis.asc
gpg: key 462405BB: public key imported
gpg: Total number processed: 1
gpg:               imported: 1
user $gpg --list-keys
/home/humpback/.gnupg/pubring.gpg
---------------------------------
pub  1024D/75447B14 2002-12-08 Larry the cow (Gentoo's own) <larry@gentoo.org>
sub  2048g/96D6CDAD 2002-12-08
  
pub  1024D/462405BB 2002-12-01 Luis Pinto <lmpinto@student.dei.uc.pt>
uid                            Luis Pinto <lmpinto@dei.uc.pt>
sub  4096g/922175B3 2002-12-01 [expires: 2003-12-01]
user $gpg --edit-key lmpinto@dei.uc.pt
gpg (GnuPG) 1.0.7; Copyright (C) 2002 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: checking the trustdb
gpg: checking at depth 0 signed=0 ot(-/q/n/m/f/u)=0/0/0/0/0/1
pub  1024D/462405BB  created: 2002-12-01 expires: 2003-12-01 trust: -/-
sub  4096g/922175B3  created: 2002-12-01 expires: 2003-12-01
(1)  Luis Pinto <lmpinto@dei.uc.pt>
(2). Luis Pinto <lmpinto@student.dei.uc.pt>
Command>fpr
pub  1024D/462405BB 2002-12-01 Luis Pinto <lmpinto@dei.uc.pt>
             Fingerprint: F056 3697 ADE3 CF98 B80B  8494 0AD3 E57B 4624 05BB
Command>sign
Really sign all user IDs? y
                           
pub  1024D/462405BB  created: 2002-12-01 expires: 2003-12-01 trust: -/-
             Fingerprint: F056 3697 ADE3 CF98 B80B  8494 0AD3 E57B 4624 05BB
  
     Luis Pinto <lmpinto@dei.uc.pt>
     Luis Pinto <lmpinto@student.dei.uc.pt>
  
This key is due to expire on 2003-12-01.
Do you want your signature to expire at the same time? (Y/n) Y
How carefully have you verified the key you are about to sign actually belongs
to the person named above?  If you don't know what to answer, enter "0".
  
   (0) I will not answer. (default)
   (1) I have not checked at all.
   (2) I have done casual checking.
   (3) I have done very careful checking.
  
   Your selection? 3
Are you really sure that you want to sign this key
with your key: "Larry the cow (Gentoo's own) <larry@gentoo.org>"
  
I have checked this key very carefully.
  
Really sign? y
              
You need a passphrase to unlock the secret key for
user: "Larry the cow (Gentoo's own) <larry@gentoo.org>"
1024-bit DSA key, ID 75447B14, created 2002-12-08
Command>check
uid  Luis Pinto <lmpinto@dei.uc.pt>
sig!3       462405BB 2002-12-01   [self-signature]
sig!3       75447B14 2002-12-08   Larry the cow (Gentoo's own) <larry@gentoo.org>
uid  Luis Pinto <lmpinto@student.dei.uc.pt>
sig!3       462405BB 2002-12-01   [self-signature]
sig!3       75447B14 2002-12-08   Larry the cow (Gentoo's own) <larry@gentoo.org>

키 서버와의 키 교환

키 서버로 키 보내기

이제 키를 만들었으니, 키 서버로 보내 보도록 하는게 어떨까 합니다. 키 서버는 전세계에 널려있고, 대부분의 키 서버들끼리 공용키를 주고받습니다. 이 예제에서 Larry 소의 키를 keys.gnupg.net 서버로 보내겠습니다. 키를 보낼 때 HTTP를 사용하므로 HTTP 트래픽에 대해 프록시를 사용한다면 이 설정( export http_proxy=http://proxy_host:port/)을 잊지 마십시오. 키를 보내는 명령은 다음과 같습니다. gpg --keyserver keys.gnupg.net --keyserver-options honor-http-proxy --send-key 75447B14 여기서 75447B14는 키 ID입니다. HTTP 프록시가 필요하지 않다면 --keyserver-options honor-http-proxy 옵션을 뺄 수 있습니다.

또한 Larry가 서명한 다른 사람의 키를 키 서버에 보내는건 좋은 방안입니다. Luis Pinto의 키를 키 서버로 보낼 수 있었습니다. 이런 방법을 통해 Larry의 키를 믿는 사람이 Luis 의 키를 믿을 수 있게 둔 서명을 사용할 수 있습니다.

키 서버에서 키 가져오기

이제 Gustavo Felisberto(이 안내서의 저자 :))의 키를 검색하고 Larry 소의 키 모음에 추가하도록 하겠습니다.

user $gpg --keyserver keys.gnupg.net --keyserver-options honor-http-proxy --search-keys humpback@felisberto.net
gpg: searching for "humpback@felisberto.net" from hkp server keys.gnupg.net
(1)	Gustavo Felisberto <humpback@gmail.com>
	Gustavo Felisberto <humpback@gentoo.org>
	Gustavo Felisberto <humpback@gentoopt.org>
	Gustavo Felisberto <gustavo@felisberto.net>
	Gustavo Felisberto <humpback@gentoo-pt.org>
	Gustavo Felisberto <humpback@felisberto.net>
	Gustavo Felisberto <gustavo@student.dei.uc.pt>
	Gustavo Felisberto <humpback@student.dec.uc.pt>
	Gustavo Felisberto (apt-get install anarchy) <humpback@felisberto.net>
	  1024 bit DSA key B9F2D52A, created: 2002-12-06
(2)	Gustavo Adolfo Silva Ribeiro Felisberto <humpback@altavista.net>
	  1024 bit DSA key 26471D8F, created: 2001-09-05
(3)	Gustavo Felisberto <humpback@altavista.net>
	  1024 bit DSA key E97E0B46, created: 1999-08-04, expires: 2000-08-04 (expired)
(4)	Gustavo A.S.R. Felisberto <humpback@altavista.net>
	  1024 bit DSA key B59AB043, created: 1998-12-10
(5)	Gustavo Adolfo Silva Ribeiro Felisberto <humpback@altavista.net>
	  1024 bit DSA key 39EB133D, created: 1998-08-27
(6)	Gustavo Adolfo Silva Ribeiro Felisberto <humpback@altavista.net>
	  1024 bit DSA key AE02AF87, created: 1998-06-15
Enter number(s), (N)ext, or (Q)uit > 1
gpg: requesting key B9F2D52A from hkp server keys.gnupg.net
gpg: key B9F2D52A: public key "Gustavo Felisberto <humpback@felisberto.net>" imported
gpg: 3 marginal(s) needed, 1 complete(s) needed, classic trust model
gpg: depth: 0  valid:   4  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 4u
gpg: next trustdb check due at 2015-06-28
gpg: Total number processed: 1
gpg:               imported: 1

서버 응답에서 키 서버로 몇가지 키를 제출했음을 볼 수 있습니다만, 현재 B9F2D52A 만을 사용합니다. 이제 Larry the cow가 키를 받을 수 있고 키를 믿을 수 있다면 키에 서명할 수 있습니다.

GPG 에이전트 사용

GPG 에이전트가 무엇인가요?

가끔 몇가지 프로그램을 다루다보면 GPG키를 빈번하게 사용하도록 요구하는데, 이는 암호를 자주 입력해야 한다는 의미입니다. 예전에는 대부분의 프로그램에서 암호 캐싱 기술을 지원했습니다. 이 기술은 암호를 자동으로 입력하므로 사용자에게 매우 편리했습니다. 그러나 프로그램 사이에서 이 캐시를 공유(보안이 어떻게 될까요?)하게끔 하는건 허락되지 않으며 프로그램에 하던 동작을 계속 하도록 강제하기도 합니다.

GPG 에이전트는 GPG가 안전한 표준 방식으로 암호를 캐싱하도록 사용하는 별개의 프로그램입니다. 이 프로그램은 다른 프로그램이 GPG를 동시에 사용하도록합니다. 어떤 프로그램 사용 중에 암호를 입력하면 다른 프로그램에서는 키 잠금을 다시 해제할 필요 없이 GPG와 동작할 수 있습니다. 물론, GPG 에이전트에서 이런 동작을 허용하도록 설정했을 경우죠.

젠투에서는 GPG 에이전트 프로그램을 제공합니다. app-crypt/gnupg 꾸러미에 참조할 것으로 간주할 수 있는 요소를 넣었으며, 이 문서에서 주로 활용합니다.

gpg-agent와 pinentry 설정

GnuPG includes gpg-agent. Pinentry (app-crypt/pinentry) is a helper application that gpg-agent uses to request the passphrase in a graphical window. It comes in many flavors including gtk2 and 3, qt4 and 5, tty and curses. It is recommended to always build the ncurses version. Set USE flags accordingly.

한가지 이상의 창 띄우기 방식으로 app-crypt/pinentry를 설치했다면 eselect pinentry 명령으로 방식을 선택할 수 있습니다.

root #eselect pinentry list
Available pinentry binary implementations:
  [1]   pinentry-gnome3 *
  [2]   pinentry-gtk-2
  [3]   pinentry-curses
  [4]   pinentry-tty
root #eselect pinentry set 1

이제 ~/.gnupg/gpg-agent.conf 파일을 만들고 다음 줄을 추가하여 암호 기본 경과 시간(예: 30분)을 정의하며 암호가 필요하다면 프로그램(pinentry GTK+ 버전)을 호출하도록 하겠습니다.

파일 ~/.gnupg/gpg-agent.conf
pinentry-program /usr/bin/pinentry-gtk-2
no-grab
default-cache-ttl 1800

이제 적당한 때에 에이전트를 사용하도록 GnuPG를 설정하겠습니다. ~/.gnupg/gpg.conf를 편집하여 다음 줄을 추가하십시오.

파일 ~/.gnupg/gpg.confGPG 에이전트를 사용하도록 GnuPG 설정
use-agent

이제 GPG 에이전트 사용 준비가 (거의) 되었습니다.

GPG 에이전트 자동으로 시작하기

데스크톱 환경으로 KDE를 활용한다면 /etc/plasma/startup/10-agent-startup.sh (시스템 전체 영역, KDE 4에서는 /etc/kde/startup/agent-startup.sh) 또는 ~/.config/plasma-workspace/env/gpg-agent.sh (로컬 사용자용, KDE 4에서는 ~/.kde4/env/gpg-agent.sh) 파일을 편집하십시오. 다음 명령을 적당한 파일에 추가하여 KDE에서 GPG 에이전트를 자동으로 시작하게 하십시오:

파일 /etc/plasma/startup/10-agent-startup.shKDE가 GPG 에이전트를 자동으로 시작하게 하기
if [ -x /usr/bin/gpg-agent ]; then
 eval "$(/usr/bin/gpg-agent --daemon)"
fi

또한 /etc/plasma/startup/10-agent-shutdown.sh (시스템 전체 영역, KDE 4에서는 /etc/kde/startup/agent-shutdown.sh) 파일에서 다음 줄의 주석 표시를 제거하시거나 ~/.config/plasma-workspace/shutdown/gpg-agent.sh (로컬 사용자용, KDE 4에서는 ~/.kde4/shutdown/gpg-agent.sh) 파일에서 추가하십시오:

파일 /etc/plasma/shutdown/10-agent-shutdown.sh플라즈마에서 GPG 에이전트를 끄도록 설정
if [ -n "${GPG_AGENT_INFO}" ]; then
  kill $(echo ${GPG_AGENT_INFO} | cut -d':' -f 2) >/dev/null 2>&1
fi

KDE가 아닌 각기 다른 데스크톱 환경을 사용한다면, startx 명령으로 X.org를 시작하는 경우에는 ~/.xinitrc 파일에, XDM, GDM, KDM 등을 사용할 때는 ~/.xsession 파일에 위 줄을 추가하십시오.

문서 작성시 활용하기

암호화 및 서명

이제 Larry에게 보내려는 파일이 있다고 해보겠습니다. 이걸 암호화 할 수 있고, 서명할 수도 있으며, 심지어는 암호화와 서명을 동시에 할 수도 있습니다. 암호화는 Larry만이 열 수 있음을 의미하며, 서명은 Larry에게 이 파일을 만든 진짜 사람이 여러분임을 알려줍니다.

암호화하려면:

user $gpg --output doc.gpg --encrypt --recipient lmpinto@dei.uc.pt doc_to_encrypt

서명하려면:

user $gpg --output doc.gpg --sign --recipient lmpinto@dei.uc.pt doc_to_sign

암호화 및 서명하려면:

user $gpg --output doc.gpg --encrypt --sign --recipient lmpinto@dei.uc.pt doc_to_encrypt_and_sign

이 명령으로 이진 파일을 만듭니다. ASCII 파일을 만들려면 다음 명령 시작 부분에 --clearsign 옵션을 추가하기만 하십시오.

해독 및 서명 검증

Larry가 암호화 처리한 파일을 받았다고 가정해보겠습니다. 해독할 명령은 gpg --output document --decrypt encrypted_doc.gpg입니다. 이 명령으로 문서를 해독하고 서명(이 있다면)을 검증합니다.

키 없이 암호화 및 해독

키 대신 암호를 사용하여 파일을 암호화 할 수 있습니다. 글쎄요, 암호 자체는 키 처럼 동작합니다 - 대칭 암호처럼 사용합니다. gpg --symmetric 명령을 활용하여 파일을 암호화 할 수 있습니다. 해독할 때는 위에서 우리가 이야기 했던 대로 같은 명령을 사용하시면 됩니다.

user $gpg --output document.gpg --symmetric document

GnuPG에서는 암호를 물어보고 암호 검증을 수행할 것입니다.

고급 기능

GnuPG에는 몇가지 고급 기능이 있습니다. 이를 찾아보려면 ~/.gnupg/gpg.conf 파일을 열어보십시오.

파일 ~/.gnupg/gpg.conf
#keyserver x-hkp://keys.gnupg.net
#keyserver-options auto-key-retrieve include-disabled include-revoked

두 줄을 찾아서 주석 표시를 지우십시오. 수정한 설정을 통해 GnuPG에서는 언제든지 서명을 확인하려 하며, 로컬 키 모음에 공용키를 찾으려 하지 않을 것이고, keys.gnupg.net 서버에 요청하여 공용키를 가져오려 시도합니다.

다른 괜찮은 명령으로는 gpg --refresh-keys가 있습니다. 이 명령은 설정 파일에 지정한 키 서버와 연결하여 로컬 키 모음의 공용키를 새로 고칩니다. 폐기한 키, 새 ID, 새 서명을 검색할 수 있습니다. 한 달에 한 두번은 이 명령을 실행하는게 좋습니다. 어떤 사람이 자신의 키를 버리면 키 자체에서 더 이상 신뢰할 수 없음을 알릴 수 있습니다.

GnuPG 인터페이스

전자메일 서명 정보

GnuPG를 전자메일과 함께 사용하는 95%의 목적은 보내는 메시지를 서명하고 암호화 하거나 서명/암호화 한 메시지를 읽는데 있습니다.

GnuPG로 전자 메일을 서명/암호화 하는데 두가지 방법이 있는데, 예전 방법과 최근의 방법입니다. 예전 방법대로는 메시지는 평문으로 나타나지만, 가능한 형식을 갖추지 않고, 첨부한 파일에 대해서는 서명 및 암호화를 하지 않습니다. 여기에 예전 방식대로의 메시지 서명 예를 들도록 하겠습니다:

코드 평문 서명
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
  
Test message
  
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use
  
iQA/AwUBP8461jMX0745gR7AEQIEOwCg011GbufXO3ED3FkLWXmfzg7xm1cAoJD0
0EU3Kd2EKNCqataEqM5qjpPs
=LchZ
-----END PGP SIGNATURE-----

HTML을 인식하는 기능을 갖춘 GUI 기반 전자메일 읽기 프로그램에게는 오늘날 이 방식대로 주고 받는 메시지가 썩 좋은 방식이 아닙니다.

이러한 추가 문제를 해결하기 위해 MIME(다중 목적 인터넷 메일 확장)을 만들었습니다. 이 규약을 통해 메일 보기 프로그램에 메시지 전체 내용을 서명했는지 암호화했는지를 알려주는 필드를 추가했습니다. 이에 대한 문제는 모든 메일 보기 프로그램이 이 기능을 지원하지 않는다는 점입니다. 일부 내용을 잘라버리기도 합니다(마이크로소프트 아웃룩은 이 기능을 지원하지 않기로 유명한 프로그램입니다).

Kgpg

kgpg (kde-base/kmail)는 GnuPG용으로 사용하는 멋들어진 GUI 프로그램입니다. 주 화면에는 서명 또는 암호화 한 테그트를 붙여넣을 수 있고, 그 반대도 가능합니다. 복호화할 ASCII로 이루어진 텍스트도 입력할 수 있습니다.

Seahorse

seahorse (app-crypt/seahorse)는 그놈 데스크톱용 GnuPG GUI 인터페이스를 목표로 합니다. 이 프로그램은 빠르게 발전을 거듭해왔지만, kgpg나 명령줄 버전의 프로그램에서 대부분의 중요하다고 생각되는 기능이 빠져있습니다.

KMail

crypt USE 플래그를 설정했다면 KMail은 gpg 지원을 포함하여 컴파일 하며, OpenPGP/MIME 메일을 암호화하고, 자체 PGP 메일을 자동으로 암호화/해독 할 수 있습니다. OpenPGP/MIME 메일을 해독하려면(대부분 사용자들이 원하는 대로) GPG 에이전트를 실행하고 있어야 합니다.

Settings → Configure KMail → Security → Crypto Backends로 이동하여 KMail을 제대로 설정했는지 확인하십시오. GpgME 기반 백엔드 목록을 볼 수 있어야 하고, OpenPGP 확인 상자에 표시할 수 있어야 합니다. 목록에는 있는데 회색으로 표시되어 있다면, Rescan을 누르십시오. GpgME 기반 백엔드가 그래도 회색으로 표시되어 있다면, KMail이 제대로 동작하고 있는 것은 아닙니다.

KMail에서 이 기능을 쓸 수 없다면, 공식 KMail PGP 페이지 에서 더 많은 내용을 알아보십시오.

Claws-Mail

이 메일 클라이언트en는 큰 용량의 메일함에 매우 빠르게 동작하며, GPG와 상당히 잘 동작하고, 메일 보기 프로그램에 바라는 세련된 모든 기능이 다 들어있습니다. 유일한 문제라면 예전 PGP 서명으로는 동작하지 않기 때문에 이런 메일을 받게 되면 서명을 직접 확인해야 합니다.

Claws-Mail에서 gpg 키를 사용하려면 계정 설정 → 개인정보 탭으로 이동하십시오. 어떤 키를 사용할 지 선택했으면 대부분 사용자에게 기본 키를 넣어 보내야합니다.

공용키 암호화

기본 공용키 암호화 기법

마무리 생각과 고마운 사람들

몇가지 문제

키에 들어간 사진에 약간의 문제가 있습니다. 어떤 버전을 사용하는지 확인하십시오. GnuPG 1.2.1-r1 이상이면 괜찮습니다, 그러나 그 이전의 버전이라면 문제가 있을 수 있습니다. 또한 대부분의 키 서버에서는 키랑 사진이 붙어있는걸 별로 좋아하지 않으므로, 사진을 추가하지 않는다면 괜찮습니다.

GnuPG 최신 버전에서는 공용 서버로 키 모음의 모든 키를 보내는데 사용하던 gpg --send-keys 실행 파일이 깨진 것 같습니다.

여기에 없는 내용

gpg is a very complex tool. It lets users do much more than what has been covered here. This document is for users who are new to GnuPG. For more information check out the official GnuPG website.

This article does not cover tools such as pgp4pine, gpgpine, evolution, and Windows GPG tools.

고마운 사람들

John Michael Ashley's GnuPG Handbook is a very good book for beginners.

Swift(Sven Vermeulen)가 이 글을 다시 작성하라고 독촉해주었습니다.

#gentoo-doc 에 있는 팀원 모두들 대단했습니다.

Tiago Serra는 절 개인 정보 분야를 다시 맏게 해주었습니다.

External resources