3

I was reading the following document:
https://www.digitalocean.com/community/tutorials/understanding-the-ssh-encryption-and-connection-process

In the asymmetric encryption it looks like the shared secret key (symmetric key) is always used to encrypt/decrypt the messages between the client and server. I was confused why it's called asymmetric encryption when the private and public key is used only in authentication? Is asymmetric encryption (public and private key) used in encrypting messages after authentication? Or is the shared secret key only used in both (symmetric and asymmetric), private and public key in both should be used for authentication only right?

  • @MartinPrikryl thanks for the reply. so you mean the public/private key is not only used in authentication. they are used for exchanging shared key (in asymmetric encryption) ? the shared key is always used to encrypt/decrypt messages right ? ( even in the asymmetric encryption ) – Mohammad Karmi Nov 1 '18 at 17:41
  • For authentication, your and server's key pairs are used. For key exchange another different and temporary keys are used. – Martin Prikryl Nov 1 '18 at 17:42
  • @MartinPrikryl correct. but for message encryption/decryption only the shared key is used right ? ( even in asymmetric encryption case) – Mohammad Karmi Nov 1 '18 at 17:43
  • Yes. That's correct. Though I do not understand what you mean by "asymmetric encryption case" – Martin Prikryl Nov 1 '18 at 17:44
  • 1
    It's not asymmetrical vs symmetrical case. There's not such "choice" in SSH. Those sections only generally explain what asymmetrical vs symmetrical mean. – Martin Prikryl Nov 1 '18 at 17:46
4

In the asymmetric encryption it looks like the shared secret key (symmetric key) is always used to encrypt/decrypt the messages between the client and server.

In SSH (not in asymmetric encryption), shared secret key (symmetric key) is always used to encrypt/decrypt the messages between the client and server.

I was confused why it's called asymmetric encryption when the private and public key is used only in authentication?

It's not called an asymmetric encryption, it's a symmetric encryption when a shared key is used. The asymmetric encryption is used to exchange the shared key and optionally for an authentication. Though in both cases, different keys are used.

Is asymmetric encryption (public and private key) used in encrypting messages after authentication?

No.

Or is the shared secret key only used in both (symmetric and asymmetric), private and public key in both should be used for authentication only right?

There's no "both". It looks like you understood from the document that there's some choice between "symmetric" and "asymmetric" in SSH. There's not. Both symmetric and asymmetric encryption is used in SSH, but for specific tasks. And you cannot choose, when is which of them used.

Private and public keys (the ones you know of) are used only for an authentication. There are other temporary asymmetric keys used for shared (symmetric) key exchange. But you are not involved in any way with those keys.

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.