title: Implementation ideas for authentication between two parties
body: <p>I would like to implement an authentication between two parties (for example a user and a bank) but I stumbled upon a &quot;design/implementation&quot; doubt.
  I need to do this steps:</p>
  <ol>
  <li>user to communicate his address [something related to my project]
  encrypted with bank's public key</li>
  <li>bank decrypt address and send to that address some data (for authentication purpouses) encrypted
  with user public key</li>
  <li>user decrypt and use digital signature to sign that data and send it
  back (like before and blablabla)</li>
  </ol>
  <p>I've created the server [with nodejs-&gt;express] which provides endpoints for:</p>
  <ul>
  <li>registration of users/banks [or other requesters of authentication]</li>
  <li>encryption with pub key</li>
  <li>decryption with private key sent as a parameter</li>
  <li>digital signature</li>
  </ul>
  <p>The question is:</p>
  <p>Now, are banks that needs to call with the right sequence my endpoints to authenticate users or should I create a new Endpoint like /authenticate and in some way automatically retrieve the user+bank requests to my endpoints?
  The first option seems more like an api service but I don't know if it's the only way to do it.
  And for the second one i have no idea how to do it.</p>
  <p>(Sorry for my bad english I'm Italian, I do only know pizza pasta peperoni language)</p>