Exporting Diffie Hellman's session key RRS feed

  • Question

  • I'm trying to make ssh client using cryptoapi. To perform key exchange i need to use session key in raw state. It seems to be impossible to export raw Diffie Hellman's session key when it is in CALG_AGREEDKEY_ANY state. Windows mobile cryptoapi have CryptGetKeyParam with KP_Z to get what i need. There is no KP_Z on regular cryptoapi. Currently only way to get session key is to use CryptExportKey with OPAQUEKEYBLOB as blob type. This gives some unknown structure which has session key. But structure differs in size on different windowses. On winxp it is 32 bytes smaller than on Win7. Also it is suppose to be used only to import this opaque blob back into system not use it elsewhere. All other blob types gives error.
    Sunday, December 13, 2009 9:41 AM

All replies