Pretty Good Privacy [PGP] adalah sebuah fitur yang memungkinkan seseorang mengirim file/email yang ter-enskripsi dan pihak lain yang menerimanya melakukan dekripsi dengan kunci terpisah. PGP memanfaatkan public-key cryptography yang memang memisahkan antara kunci enskripsi dengan kunci deskripsinya. Jadi PGP adalah metoda enskripsi dua arah [dan bukan one way seperti MD5] namun sangat aman. Algoritma enkripsi yang didukung PGP antara lain : CAST, AES, 3DES, dan Twofish.
-
$ pwd
/usr/home/handaru
-
$ mkdir .pgp
-
$ PGPPATH=/usr/home/handaru/.pgp; export PGPPATH
-
me-generate kunci enskripsi publik sekaligus bersesuaian dengan kunci deskripsinya :
$ pgp -kg
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: 2007/12/27 04:03 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 , if you have an E-mail address. For example: John Q. Smith <12345.6789@compuserve.com> Enter a user ID for your public key:
handaru <handaru@light19.com>
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:,br>Enter same pass phrase again:
Note that key generation is a lengthy process.
We need to generate 582 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:
0 * -Enough, thank you.
….**** ………………………………………****
Pass phrase is good. Just a moment….
Key signature certificate added.
Key generation completed.
-
Hasilnya Anda akan mendapatkan dua file PGP : secring.pgp dan pubring.pgp. PGP menggunakan key rings untuk menyimpan kunci-kuncinya. Secara default, private secret key ring handaru adalah secring.pgp dan public key ring handaru adalah pubring.pgp :
$ cd .pgp
$ ls
pubring.bak pubring.pgp randseed.bin secring.pgp
-
Kita bisa melihat suatu key ring dengan perintah :
$ pgp -kv secring.pgp
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: 2007/12/27 04:37 GMT
Key ring: ’secring.pgp’
Type Bits/KeyID Date User ID
sec 1024/D2CD5C6D 2007/12/27 handaru <handaru@light19.com>
1 matching key found.
-
Untuk memberikan public key kita ke seseorang, cukup kita salinkan public key ring [pubring.pgp] kita ke dia.
-
Sebaliknya jika perlu mengakses public key ring orang lain, maka public key ring orang itu perlu kita masukkan dulu public key ring orang itu ke key ring kita. Misalkan public key ring orang itu adalah saktipubring.pgp [file hasil generate oleh sakti] maka cara memasukkannya ke key ring kita adalah :
$ pgp -ka saktipubring.pgp
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: 2007/12/27 04:58 GMT
Looking for new keys…
pub 1024/810B850D 2007/12/27 handarusakti <handarusakti@yahoo.com>
Checking signatures…
pub 1024/810B850D 2007/12/27 handarusakti <handarusakti@yahoo.com>
sig! 810B850D 2007/12/27 handarusakti <handarusakti@yahoo.com>
Keyfile contains:
1 new key(s)
One or more of the new keys are not fully certified.
Do you want to certify any of these keys yourself (y/N)? y
Key for user ID: handarusakti <handarusakti@yahoo.com>
1024-bit key, key ID 810B850D, created 2007/12/27
Key fingerprint = 0A 41 21 C7 4B BD E7 5B 01 9E 06 80 FB 72 A3 77
This key/userID association is not certified.
Questionable certification from:
handarusakti <handarusakti@yahoo.com>
Do you want to certify this key yourself (y/N)? y
Looking for key for user ‘handarusakti <handarusakti@yahoo.com>’:
Key for user ID: handarusakti <handarusakti@yahoo.com>
1024-bit key, key ID 810B850D, created 2007/12/27
Key fingerprint = 0A 41 21 C7 4B BD E7 5B 01 9E 06 80 FB 72 A3 77
READ CAREFULLY: Based on your own direct first-hand knowledge, are
you absolutely certain that you are prepared to solemnly certify that
the above public key actually belongs to the user specified by the
above user ID (y/N)? y
You need a pass phrase to unlock your RSA secret key.
Key for user ID: handaru <handaru@light19.com>
1024-bit key, key ID D2CD5C6D, created 2007/12/27
Enter pass phrase: Pass phrase is good. Just a moment….
Key signature certificate added.
Make a determination in your own mind whether this key actually
belongs to the person whom you think it belongs to, based on available
evidence. If you think it does, then based on your estimate of
that person’s integrity and competence in key management, answer
the following question:
Would you trust "handarusakti <handarusakti@yahoo.com>"
to act as an introducer and certify other people’s public keys to you?
(1=I don’t know. 2=No. 3=Usually. 4=Yes, always.) ? 4
-
Selanjutnya kita akan menggunakan PGP untuk mengenkripsi sebuah file. Misalnya handaru ingin mengirim file dariku.txt kepada sakti namun file tersebut ingin di-enskripsi terlebih dahulu dengan public key ring PGP milik sakti. Maka handaru bisa melakukan langkah berikut :
$ pgp -e dariku.txt sakti
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: 2007/12/27 05:05 GMT
Recipients’ public key(s) will be used to encrypt.
Key for user ID: handarusakti <handarusakti@yahoo.com>
1024-bit key, key ID 810B850D, created 2007/12/27
.
Ciphertext file: dariku.txt.pgp
- Maka akan menghasilkan file dariku.txt.pgp :
$ ls |grep dariku
dariku.txt
dariku.txt.pgp
File dariku.txt.pgp inilah yang bisa dikirim oleh handaru ke sakti.
-
Setelah file dariku.txt.pgp tadi diterima oleh sakti dan jika sakti ingin membuka file di atas, sakti bisa melakukannya dengan perintah :
$ pgp dariku.txt.pgp
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: 2007/12/27 05:29 GMT
File is encrypted. Secret key is required to read it.
Key for user ID: handarusakti <handarusakti@yahoo.com>
1024-bit key, key ID 810B850D, created 2007/12/27
You need a pass phrase to unlock your RSA secret key.
Enter pass phrase: Pass phrase is good. Just a moment……
Plaintext filename: dariku.txt
$ ls |grep dariku
dariku.txt
dariku.txt.pgp
Di sini, sakti menggunakan secring.pgp miliknya untuk medekripsikan file kiriman handaru yang telah mengenkripsi file yang dikirimnya dengan public key milik sakti. Makanya pada pengantar di atas, dikatakan bahwa PGP mempunyai key enskripsi dan dekripsi yang terpisah.
-
File hasil proses enskripsi PGP di atas : dariku.txt.pgp berbentuk file binary, jika ingin membuat file yang terenskripsi PGP namun dalam bentuk ASCII, sewaktu melakukan enskripsi gunakan opsi perintah -a :
$ pgp -ea dariku.txt sakti
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: 2007/12/27 05:56 GMT
Recipients’ public key(s) will be used to encrypt.
Key for user ID: handarusakti <handarusakti@yahoo.com>
1024-bit key, key ID 810B850D, created 2007/12/27
.
Transport armor file: dariku.txt.asc
FreeBSD…AMAN TERKENDALI.