티스토리 뷰

보안

GNU Privacy Guard(GPG) 사용법

IT 2010. 12. 16. 15:48
GNU PGP 파일과 이메일메시지를 암호화 할 수 있는 오픈소스이다.
gpg를 설치하려면 http://www.gnupg.org 에서 리눅스 또는 윈도우용으로 다운로드 받아 볼 수 있다.

사용법 
1. gpg 명령옵션 보기
  명령어 : gpg -h

2. key pair 생성하기
  명령어 : gpg --gen-key

  진행절차 :
Logged in as username:

 

/home/username >gpg --gen-key 

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: keyring `/home/username/.gnupg/secring.gpg' created

gpg: keyring `/home/username/.gnupg/pubring.gpg' created

Please select what kind of key you want:

   (1) DSA and ElGamal (default)

   (2) DSA (sign only)

   (4) ElGamal (sign and encrypt)

   (5) RSA (sign only)

Your selection? Your selection? 1

What keysize do you want? (1024)

Requested keysize is 1024 bits  

Please specify how long the key should be valid.

         0 = key does notexpire

      <n>  = key expires in ndays

      <n>w = key expires in n weeks

      <n>m = key expires in nmonths

      <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 constructsthe user id

from Real Name, Comment and Email Address in this form:

    "Heinrich Heine (Der Dichter)<heinrichh@duesseldorf.de>"

 

Real name: username

Email address: test@test.com

Comment: Iron Mountain GNU PGP 1024 RSA - Expires Never

You selected thisUSER-ID:                            

    "username (company name GNU PGP 1024 RSA -Expires Never) <test@test.com>"

 

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O

You need a Passphrase to protect your secretkey.    No passphrase needed or passphrase 


We need to generate a lot of random bytes. It is a good idea toperform

some other action (type on the keyboard, move the mouse, utilizethe

disks) during the prime generation; this gives the random number

generator a better chance to gain enough entropy.

..+++++

.....+++++

gpg: /home/username/.gnupg/trustdb.gpg: trustdb created

public and secret key created and signed.

key marked as ultimately trusted.

 

pub  1024R/123456F 2002-08-15 username (companyname GNU PGP1024 RSA - Expires Never) <valid e-mail address>

     Key fingerprint = willbe generated


3. key 확인하기
  명령어 : gpg --list-keys
             gpg --secret-key

4. 취소인증서 생성하기
  명령어 : gpg --output revoke.asc --gen-revoke test@test.com

5. key import, export
  명령어 : gpg --export --armor > abc.asc
              gpg --import abc.asc
  
6. 파일 암/복호화
  명령어 : gpg --encrypt -r username test.txt
              gpg --decrypt test.txt.gpg > test2.txt





'보안' 카테고리의 다른 글

보안인증서 설치  (0) 2010.12.27
openssl 사용방법  (0) 2010.12.27
JDK keytool 사용방법  (0) 2010.12.27
openssl s_client 사용방법  (0) 2010.12.27
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31