Sophia F. answered 07/25/23
Experienced High School Tutor Specializing in English
This is the rule of thumb for using hyphens: if the two nouns are being used as one adjective, hyphenate it.
For example, in the sentence you provided, "key exchange" is being used as one adjective, not two separate nouns, so we write it as key-exchange.
I hope this helps :)