title: How can two devices communicating over a secure channel come to a shared secret?
body: <p>I have two Android devices running an app. The app uses the <a href="https://github.com/bumptech/bump-api-android" rel="nofollow">Bump API</a> to exchange information with the goal to come up with a shared secret for later use.</p>
  
  <p>Specifically, the shared secret will later be sent to a central server where the devices are then registered as a "couple".</p>
  
  <p>I came up with two types of solutions, but there must be other ones as well.</p>
  
  <ol>
  <li>Decide which of the two devices may generate the secret (e.g., by flipping a coin)</li>
  <li>Let both devices input a part of the secret and combine them (e.g., multiplying or XORing the two contributions)</li>
  </ol>
  
  <p>What is the best solution for this situation?</p>
  
  <p>--EDIT--
  I'm not trying communicate securely (I consider the Bump channel secure enough).
  Rather, I'm trying to find the most elegant solution to this specific issue.</p>