Symmetric encryption VS Asymmetric encryption

Encryption is a process of encoding the plaintext with a key to generate ciphertext so that the plaintext is unreadable. In such a way, the confidentiality of the original message is guaranteed.

Decryption is a process of decoding the ciphertext with a key to generate the readable plaintext.

Let's suppose Alice has a confidential document that she wants to send to Bob.

Symmetric encryption

  1. Alice uses an encryption program to encrypt the document with a password (the key).
  2. She then sends the encrypted document to Bob.
  3. Bob uses the same password to decrypt the document.
  4. After the decryption, Bob gets the readable confidential document.

In the above process, Alice and Bob has to keep the key secret and safe. Otherwise the confidentiality of the document might be breached. Here comes a question, how could Bob know the key? or how shall Alice share the key with Bob?

Asymmetric encryption

Asymmetric encryption intends to solve the above problem. In asymmetric encryption, Both the sender and the recipient have a pair of keys, a public key and a private key. They are mathematically linked to each other. By linked to each other, it means if you encrypt a message with one of them, the other and only the other can be used to decrypt the encrypted message. But you cann't derive one from the other.

Let's look at the case of Alice and Bob. Each of them uses a computer program to generate a pair for keys, a public key and a private key. As the name implies: the public key is not a secret key, it is public; the private key must be kept secret. Before sending messages to each other, Alice and Bob have to exchange their public keys. Then

  1. Alice uses a computer program to encrypt the confidential document with Bob's public key.
  2. Alice then send the encrypted document to Bob.
  3. Bob uses his private key to decrypt the document and he gets the readable original document.

NOTE: Only Bob's private key can be used to decrypt the document. That means the others who have Bobs public key cannot decrypt the document. So, it's Alice's and Bob's responsibility to keep their private keys secure. If an attacker gets Alice's private key, he/she can decrypt all the messages send to Alice but cannot decrypt the messages that send from Alice to Bob.

The above process looks great. But what happens if the public key Alice gets from Bob is NOT actually Bobs public key? An attacker might intercept Bob's public key and replace it with his/her own private key. How can Alice be sure that the public key she gets is actually Bob's? That is the story about authentication, we'll talk about it later.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值