제가한 오픈 PGP Key를 생성하고 등록하는 방법. (Terminal)
Quote:
Importing an OpenPGP key
1. Ensure you already have a key. In a terminal window, enter:
gpg --list-keys
your@e-mail.address If you have no key, create one:
gpg --gen-key
2. Ensure the key has been uploaded to a keyserver. To do this:
gpg --send-key key-id
3. Enter your key fingerprint. Use:
gpg --fingerprint key-id
위 내용이 런치패드에서의 하라는 내용이군요.
자 일단 아무것도 없다고 생각하고 만들어 봐야 겠죠.
Code:
$ gpg —gen-key
gpg (GnuPG) 2.0.9; Copyright© 2008 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) DSA and Elgamal (default) (2) DSA (sign only) (5) RSA (sign only)
Your selection? 1
처음 물어 보는것. 리스트에 ()로 묶어져 있는 내용이 있으면 그냥 엔터를 치면 됩니다.
Code:
DSA keypair will have 1024 bits.
ELG keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
키값의 크기를 얼마나 할것인가 정의 해준다.
Code:
Requested keysize is 2048 bits
Please specify how long the key should be valid. 0 = key does not expire = key expires in n days w = key expires in n weeks m = key expires in n months y = key expires in n years
Key is valid for? (0)
어느정도의 기간동안 유효하게 설정할 것인가...
Code:
Key does not expire at all
Is this correct? (y/N) y
입력한 정보에 대한 확인 과정...
Code:
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) “
Real name: Eugene Lee
키 사용자 이름( 실제 이름) 입력
Code:
Email address: *******@hotmail.com
이메일 주소. (사용가능해야 함)
Code:
Comment: I’m the Eugene
주석부분 입력.
Code:
You selected this USER-ID: “Eugene Lee (I’m the Eugene) *******@hotmail.com>”
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
수정할 내용이 있다면 수정하고, 다음으로 넘어갈려면 “O”
Code:
You need a Passphrase to protect your secret key.
이부분에서 창이 뜨면서 입력을 받음. 키를 인코딩하거나 해독할때 쓸 키값을 입력.
Code:
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.
여기 까지 나오고 다음으로 한참 안넘어가서 잘못된줄 알았음... 그냥 웹서핑을 하던 멀하던 움직이면 됨.
Code:
gpg: key E9****** 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
pub 10***/E9****** 2009-02-11 Key fingerprint = C426 **** **** **** **** **** **** **** E9A4 0E50
uid Eugene Lee (I’m the Eugene)
sub 2048g/F7****** 2009-02-11
이게 실제로 키가 발행 완료된 내역.
여기서 key ID 라고 하는것은 첫번째 줄에 나오는 8자리의 “E9******“임.
Code:
$ gpg —send-key E9****** gpg: sending key E9****** to hkp server keys.gnupg.net
생성된 키를 기본서버인 keys.gnupg.net 서버에 등록하는 과정.
Code:
$ gpg —keyserver keyserver.ubuntu.com —send-keys E9A40E50 gpg: sending key E9****** to hkp server keyserver.ubuntu.com
우분투 관련 싸이트에서의 사용을 위해 우분투 키서버에 등록.
이 제 런치패드에서 등록을 위해 위에 나온 핑거프린트 값을 등록하고 넘어가면 등록된 이메일로 우분투 키서버에 등록된 키값을 이용해 인코딩된 메세지가 온다. 대부분의 메일서버는 이런 키를 지원하지 않기에 수동으로 직접 디코딩을 해야 하는데. 방법은 아래와 같다.
1. 이메일을 확인하고 이메일 내용중
Quote:
——-BEGIN PGP MESSAGE——-
Version: GnuPG v1.4.6 (GNU/Linux)
hQIOAxURwUP3GqO7EAf+JD/MbPQmL2XoeYKr1PCqEQlcbnkUZtmXdC8KaQfLL7EP
FbbihQFRFMrX3c6PuUvQhLF3hJexnuvB/1cqESyzN3sT1tF/0UZgIwLicls9CJo+
a+h4SVrcecXRHlXNOVFgcJymb9WBg/C6jLAbitwO69e9gBRFXxFfjHBScXSsW+qi
SIlynBSPeh9PlTUoUYSKV29fQMYtWBvQ4/GErKIRXsxVGu+qTRzUVC/nL4I9gPkn
XqDYxLjkchQIuJcFZs2g893ZS6oZZFW66kU1hfde9t8q89tbMzjqzl2i7kI+NXzl
B2ioamfFDhDncIBtnGSMNo8CF96B0zDmubh85Z9RVAf5Ad/vet+gYKvCaqLuycu6 ****************************************************************************
tAPZ5v9STE3ZbONSai8iABL9wLHIB0ud+PdoKrGWr/+/TEwjbkI4D+lVqQDn1MJn
P2u7ElJDHb5fAJsgJHRweJ5P1Aq8XT35Zni+Z5qSEqLjAFZ+G/fIg5dSxrqPnXGU
JQLecLhguE45cC4Tx17IfoKt+Yi0gXPvm01wCLQ5yBzNWdMALWEtNF6eB1EF89+X
W/+IIVuF2duYabmlrPRK+zuVSnLhh1UcIlD/zA5k60TTy9EyBKs6kEurvGq7vGrZ
+NLAxAE+Pak0QmMrlm1WLrQnovUe06FYMNW9Y26xFkvAaYPmrPI/vmlu3rq+NaJT ****************************************************************************
q+f8rpGAzWvx1ygk/5MsKmIYHATe1enqRNDPrc88/m2XR7QjIuT8HmBP6XNgddGO
w3u7QuVd/6lRls4mOYv729Qt3qABrOREXxVF+camJ1Ct3ILsHLAoXUdMe3aQuhiI
Fi5j+BwOzJA7lt9EI/BhxZurxnFaTn80iwaeOHsdEHFGAhw/DBYsMGjAUJBh3K5W
r4GMZpqMK82yPXWNuqK8GvHOxl9sNdYufMtAwKB1CldjuqePu2I3lBjThcHGiGrF
moFe72ECmCxSaOwH/SvwVwgMWl1hNQzpb99K0hPg1zj02KoWrdJNTPl5PWuSFj3G
wY58dqypqKTyQJA8TkrQz4t0yNVWR5OGp8HNml5pRl9RqaIkUwY+vuqWiKTaTnHe
9zMh/9ZDUt0=
=lTjm
——-END PGP MESSAGE——-
이부분을 전체 카피해서 임의의 파일에 저장을 한다. (보안상 중간중간 가렸음..)
2. 새로 저장된 파일명을 pgp 라고 했다면 이제 gpg를 이용해서 메세지 보기를 시도한다.
Code:
$ gpg —decrypt pgp
You need a passphrase to unlock the secret key for
user: “Eugene Lee (I’m the Eugene) <********@hotmail.com>“
2048-bit ELG key, ID F7******, created 2009-02-11 (main key ID E9******)
can’t connect to `/home/origin25/.gnupg/S.gpg-agent’: 그런 파일이나 디렉토리가 없습니다
gpg: encrypted with 2048-bit ELG key, ID F71AA3BB, created 2009-02-11 “Eugene Lee (I’m the Eugene) “
Here are the instructions for confirming the OpenPGP key registration that we
received for use in Launchpad.
Requester details:
User name : Рøstinø™ Email address: ********@hotmail.com
Key details:
Fingerprint : C42**********************************************E50 Key type/ID : 1024D/E9******
UIDs: *******@hotmail.com
Please go here to finish adding the key to your Launchpad account:
https://launchpad.net/token/WgCJCDsZm0rXS3******
이렇게 실제 메세지가 보입니다.
- 끄읕 -