JCE and CryptoAPI Interoperability
I've got a situation where I have a server written in C++ on a Windows NT system, and I'm trying to communicate a limited amount of information cryptographically from a Java client.
I've attempted to use the JCE to perform a Diffie-Hellman key exchange with the CryptoAPI, then use the secret key (once) to encrypt with DES.
I've overcome several hurdles, notably the endian-ness difference between Java and the CryptoAPI. Here's where I'm stuck:
* I can't tell if the CryptoAPI and the JCE are deriving the same secret key, since I can't figure out how to get the CryptoAPI to give me the raw bytes of the secret key.
* The JCE uses a very simple algorithm to map the secret key into a DES key (basically, it takes the first 8 bytes and sets the parity bits). However, the CryptoAPI uses a different algorithm. I've tried the experiment where I use a little-endian number on the Java side, but that's not it.
Has anyone done any interoperability between Microsoft's CryptoAPI and the JCE? I'd appreciate any assistance, especially answers to how to get the entire secret key from the CryptoAPI, or how the CryptoAPI converts the secret key into a DES key.

