0 votes
by (150 points)

Hello,

Are there more details available on the algorithm used to generate an SSH private key with RSA?

ie. when calling:

SshPrivateKey.Generate(SshHostKeyAlgorithm.RSA)

What isthe algorithm (like diffie-hellman-group-exchange-sha256), mac list (like hmac-sha2-256), and cipher list (like aes128-cbc, aes128-ctr, etc...) that is used?

Thank you

1 Answer

0 votes
by (144k points)
selected by
 
Best answer

Hello,

SshPrivateKey.Generate(SshHostKeyAlgorithm.RSA) just generates an RSA private/public key pair using either .NET's RSACryptoServiceProvider class or using Widows CNG API. The key can be saved using the Save(...) method or exported using the GetRSAParameters() method.

SSH ciphers for key exchange (such as diffie-hellman-group-exchange-sha256), MAC (such as hmac-sha2-256) or symmetric encryption (such as aes128-cbc or aes128-ctr) are used during SSH negotiation and/or for encrypting and integrity checking transmitted data once SSH negotiation has finished. However, these are not part of the RSA key and not not involved in its generation. The same RSA key can be used with any allowed combination of other ciphers.

by (150 points)
Thank you for the detailed reply
...