You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now the client algorithm for encryption, message integrity etc. is chosen randomly (in fact, the first one from the dictionary) among server supported ones, without considering the characteristics such as cryptographic strength.
Add priorities for all algorithms to make the algorithm selection more deterministic and safe.
Ok, this is not bad too. But there should be at least some default priority order which is based on algorithms' strength. For example, prioritize EC-DH, then DH with sha-256 and at last sha-1 for key exchange.
A simple solution would be to reorder the algorithms in ConnectionInfo. I removed the antiquated algorithms and reordered the compliant ones based on relative strength. The rest I leave up to the server's disgression. Providing the option for developers to have complete control over algorithm selection could open a can of worms for those not fully versed in library implementation. I do like the idea of using a builder pattern, but keep a subset of algorithms enabled by default and allow the developer to (optionally) enable older variants, similar to OpenSSH.
Activity
drieseng commentedon May 23, 2020
I was actually thinking using a builder pattern, and give the developer complete control over what algorithms are enabled and in which order.
msvprogs commentedon May 23, 2020
Ok, this is not bad too. But there should be at least some default priority order which is based on algorithms' strength. For example, prioritize EC-DH, then DH with sha-256 and at last sha-1 for key exchange.
adibradfield commentedon Aug 18, 2020
@drieseng Has anyone picked up this issue to implement the builder pattern, or is it free to work on?
lifeincha0s commentedon Sep 15, 2022
A simple solution would be to reorder the algorithms in ConnectionInfo. I removed the antiquated algorithms and reordered the compliant ones based on relative strength. The rest I leave up to the server's disgression. Providing the option for developers to have complete control over algorithm selection could open a can of worms for those not fully versed in library implementation. I do like the idea of using a builder pattern, but keep a subset of algorithms enabled by default and allow the developer to (optionally) enable older variants, similar to OpenSSH.