title: SSH documentation confusion
body: <p>I'm trying to create a very simple &amp; lightweight client implementation of the SSH protocol for node.js.</p>
  
  <p>The following documentation confuses me totally:
  <a href="http://www.snailbook.com/docs/transport.txt" rel="nofollow">http://www.snailbook.com/docs/transport.txt</a></p>
  
  <p>It lacks a full example of the whole key exchange thing. There are many things well explained, but I'm not really sure how to put those things together.</p>
  
  <p>Could you help me to put an example together?</p>
  
  <p>I'm stuck after section 7.1. I successfully receive the list of alorightms of the server, and I send a list with only the required alorithms to the server. Also successful.</p>
  
  <p>So, in this case we have the following alorightms:</p>
  
  <ul>
  <li>kex: diffie-hellman-group1-sha1</li>
  <li>key: ssh-dss</li>
  <li>encryption: 3des-cbc</li>
  <li>mac: hmac-sha1</li>
  </ul>
  
  <p>After that, I skipped section 7.2 and 7.3 and continued directly to section 8, since generating a key needs the values H &amp; K, which are generated in section 8.</p>
  
  <p>But section 8 does not make sense to me. It requires both the client &amp; the server to already know the same prime, generator and order value. When have those values been negotiated an sent to each other? Section 8 cleary says that it directly follows the algorithm exchange, so there is nothing between those steps...
  Am I missing something?</p>
  
  <p>Thanks really much for your help!</p>