Pretty Good Privacy PGP

PGP (Pretty Good Privacy)

PGP is often used for signing, encrypting and decrypting e-mails to
increase the security of e-mail communications
PGP combines symmetric-key encryption and public-key encryption.



主要就是用來加密 email 使用,運作原理其實說穿了也沒什麼,基本上就是
非對稱加密 & 對稱加密 兩個混合在一起使用。

PGP combines symmetric-key encryption and public-key encryption.

session key is protected by encrypting it with the receiver's public key thus
ensuring that only the receiver can decrypt the session key. The encrypted
message along with the encrypted session key is sent to the recipient

1. 對稱加密的部份,稱為 session key (優點:對稱加密速度快)
2. 非對稱加密的部份,則拿來做數位簽章

詳細方法如下

(email 內文) --HASH--> (摘要 Digest) --A的私key--> (簽章)

(email 內文 + 簽章) --使用session key加密--> SK(email 內文 + 簽章)

(session key) --使用B 的public key 加密--> BK(session key)

最後送出的資料 [ SK(email 內文 + 簽章), BK(session key) ]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
內文與簽章用session key (SK)保護;
session key 本身是用 B 的 public key (BK)保護

轉至這篇:傳送門
寫的淺顯易懂

------------------------------------------------------------------------

傳送端: 假設A

1. 接收端(B)將其電子憑證送給傳送端(A)端,並由CLIENT的browser來解讀。

2. 傳送端(A)向CA詢問 [公鑰CA],來解開憑證,即可得到接收端(B)的public key。

3. 隨機產生一對對稱式金鑰 session key

4.  A把 [公鑰A] 交給可信任的 Certificate Authority(CA)簽發憑證

5.  CA 會用 [私鑰CA] 加密,成為 [憑證] 送還給 A。

6. (email 內文) --HASH--> (摘要 Digest) --A的私key--> (簽章)

7. (email 內文 + 簽章) --使用session key加密--> SK(email 內文 + 簽章)

8. (session key) --使用B 的public key 加密--> BK(session key)

● 最後送出的資料 [ SK(email 內文 + 簽章), BK(session key), A的憑證]



 接收端: 假設B

1. 接收端(B)向CA詢問 [公鑰CA],來解開憑證,即可得到接收端(A)的public key。

2. 用自己的private key(私鑰B)解BK,得到 session key

3.再用session key將SK解開,得到email 內文 + 簽章

4.  (email 內文) --HASH-->得到128bit的訊息摘要
 
     使用A公鑰解開簽章,得到 訊息摘要

5. 將兩個訊息摘要做比對,判斷email 內文是否有被串改

6. 若兩個 訊息摘要相等,即得到傳送端的內文
































留言

這個網誌中的熱門文章

數位信封 Digital Envelope

SSL的運作原理