title: Determining a Private Key (Diffie-Hellman)
body: <p>I've been given a challenge and it has to do with testing a friend's encryption process.</p>
  
  <p>It's a Diffie-Hellman exchange process, and here are the known variables / constants: </p>
  
  <ul>
  <li><code>P</code>, <code>G</code> </li>
  <li>my generated private key (variable)</li>
  <li>my generated public key(variable)</li>
  <li>the recipients public key (constant). </li>
  </ul>
  
  <p>When looking at my private key - <code>P</code> and <code>G</code> are both within it. For example, the first 'x' bytes seem to have no relation to anything, then the next 'y' bytes are <code>P</code>, the next two bytes are static, and the next 'z' bytes are <code>G</code>, the remainder are variable.</p>
  
  <p>The process is to encrypt a file, and send it to a device, which will in turn decrypt it - my ideas of attack are this:</p>
  
  <ol>
  <li><p>try to duplicate the secret shared key. The problem here is that is fine as long as I know my generated private key, at which case - I don't for the files he's given me.</p></li>
  <li><p>Try to find the recipients private key. Here, I could brute force my way in - but would take forever unless I had some sort of supercomputer.</p></li>
  </ol>
  
  <p>Are there any other options to look at when trying to attack this?</p>