对称与非对称密钥

Symmetric or Asymmetric Key(s).

The concept of symmetry and asymmetry refers to the keys distribution in 2 parties (sender and receiver). If the information is encoded and decoded with the same key kk, we say the scheme is symmetric. Otherwise, it is asymmetric.

Private Key Encryption and MAC

Private key encryption scheme and message authentication code (MAC) are symmetric primitives. In fact, private key encryption scheme is also called symmetric encryption.

Private key encryption: Alice encrypts the message mm by running Enck(m)→cEnc_k(m)\to c. Bob decrypts the ciphertext cc by running Deck(c)→mDec_k(c)\to m.

Message authentication code (MAC): Alice authenticates mm by running Mack(m)→tMac_k(m)\to t. Bob verifies the tag tt by checking Vrfyk(m,t)Vrfy_k(m,t) equals to 11 or not.

Message Authentication Code (MAC) provides integrity, which ensures that the information is not tampered during transmission.

Alice applies the MAC algorithm to mm and produces an unforgeable tag t:=Mack(m)t:=Mac_k(m). Alice sends the tag tt along with the message mm: Bob then verifies the tag to check whether the message mm is tampered or not.

Public Key Encryption and Digital Signature

Public key encryption scheme and digital signature are asymmetric primitives. Public key encryption scheme is also called asymmetric encryption.

In asymmetric primitives, the key-generation algorithm Gen(1n)Gen(1^n) will produce a pair of keys ⟨pk,sk⟩\langle pk, sk \rangle. The public key pkpk is publicly distributed, while private key sksk is only held by one party.

Public key encryption: Alice encrypts the message mm with public key pkpk by running Encpk(m)→cEnc_{pk}(m)\to c. Bob decrypts the ciphertext cc with private key by running Decsk(c)→mDec_{sk}(c)\to m.

Digital signature: Alice signs mm with private key by running Signsk(m)→σSign_{sk}(m)\to \sigma. Bob verifies the signature σ\sigma by checking Vrfypk(m,σ)Vrfy_{pk}(m, \sigma) equals to 11 or not.

Note that in public key encryption, receriver Bob holds the private key; while in digital signature, sender Alice holds the private key.

MAC Versus Digital Signature

MAC and digital signature both provide integrity. However, the asymmetry of digital signature guarentees more than that.

  • Public Verifiability

    A third party not directly participating in the protocol should also be able to verify the generated values. It is based on the publicity of pkpk. MAC cannot achieve this since kk must be kept secret for the defence of a malicious third party.

  • Transferability

  • Non-repudiation

    Once the signer signs a message mm, he can NOT deny having done so afterwards. It is based on the secrecy of sksk: sksk is only known by signer and is paired up with pkpk. Anyone with pkpk could convince that signer holds sksk with zero-knowledge of sksk.