1
$\begingroup$

According to image 1, for two way communication, each person needs to generate a pair of keys. However, according to image 2, only one pair of keys is required for two way communication. Thanks to anyone who can settle my confusion.

Source 1

If a two-way communication is required between all five workers, then they all need to generate their own matching public and private keys. Once this is done, all users then need to swap public keys so that they can send encrypted documents, files or messages between each other. Each worker will then use their own private key to decrypt information being sent to them.

Source 2

the other key is known as the private key. Data encrypted with the public key can only be decrypted with the private key, and data encrypted with the private key can only be decrypted with the public key. Public key encryption is also known as asymmetric encryption. It is widely used, especially for TLS/SSL, which makes HTTPS possible.

$\endgroup$
  • 1
    $\begingroup$ Don't use images as main content of your post. This makes your question impossible to search and inaccessible to the visually impaired; we don't like that. Please transcribe the text. $\endgroup$ – D.W. Feb 5 at 16:53
0
$\begingroup$
  1. Source

We don't use public-private keys to encrypt files or documents. We use public-key cryptography for hybrid encryption or digital signatures.

Examples of Hybrid encryption.

  • RSA as Key Encapsulation Mechanism (KEM)) and AES-GCM as Data Encapsulation Mechanism (DEM). This composition of a KEM and a DEM (data encapsulation mechanism; an authenticated cipher serves as a DEM) provides the standard of IND-CCA2/NM-CCA2—ciphertext indistinguishability and nonmalleability under adaptive chosen-ciphertext attack. That is the minimum requirement for modern Cryptography. See the detail, here

  • Similarly, one can achieve with Diffie-Hellman key exchange (DHKE). Two-party exchange keys by the DHKE and generate the sessing key by using a Key Derivation Function. And with the derived key, we use a modern mode of operation like AES-GCM or ChaCha20-Poly1305. Both are Authenticated Encryption modes that provide us with Confidentiality, Integrity, and Authentication.

  • With libsodium you can start to use crypto_box_curve25519xsalsa20poly1305. Based on Elliptic Curver DHKE: Curve X25519, Encryption: XSalsa20 stream cipher, Authentication: Poly1305 MAC.

Digital signatures:

  • Here only warn about the common mistake on RSA. RSA decryption is not signature. RSA signature requires special padding RSA-PSS and using the same RSA setup for encryption and signature is not advised.
  1. Source

It tells almost nothing about the TLS,

According to image 1, for two way communication, each person needs to generate a pair of keys. However according to image 2, only one pair of keys is required for two way communication. Thanks to anyone who can settle my confusion.

Source 2 only talk about public-private key usage. However, there is a misconception there. You don't encrypt with your private key. The sole purpose of encryption is confidentiality. Your public key is public, so everybody can use your public key to decrypt the message encrypted with your private key!

To send an encrypted message to you, you either share a common secret key with the other party - that we don't prefer - or have a private and public key pair. With this pair, once you publish your public key, everybody can send you a message, even anonymously. If you don't want anonymous messages, then the other site must have a public-private key which you know the public key belongs to them. Rest, use a hybrid cryptosystem as above.

The 2. source only talk about in this way, explicitly they are talking the same. Each user at least one public-private key and distribute their public key. Of course, you may need a Certificate Authority to prove the ownership of the public key.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Is there a difference between key encapsulation in hybrid encryption, and data signatures? $\endgroup$ – Dylan Feb 9 at 14:08
  • $\begingroup$ A digital signature is a different subject. Why do you think that there is a relation? $\endgroup$ – kelalaka Feb 9 at 14:10
  • $\begingroup$ They both use assymetric encryption to provide authentication $\endgroup$ – Dylan Feb 9 at 14:13
  • $\begingroup$ It is not key encapsulation that provides authentication there, It is GCM that provides authentication of the message and that is performed with the shared key. The authentication that comes from the Digital signatures is unique to the sender. $\endgroup$ – kelalaka Feb 9 at 14:24
  • $\begingroup$ Assymetric encryption handles the key encapsulation and key exchange part of hybrid encryption. These parts provide confidentiality. Symmetrical encryption handles the data encapsulation and data exchange in hybrid encryption, the GCM within symmetrical encryption provides authentication. Is this correct? $\endgroup$ – Dylan Feb 9 at 15:06
0
$\begingroup$

The first source is being imprecise when they say "need". What they mean is that this is one way to accomplish it.

The second source doesn't say what you claim it says.

I suggest studying key exchange protocols and learning how SSL works.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.