I am trying to perform a ECDH key exchange between MS CNG and another device. In order to debug things, I would like to see what shared secret is being generated in CNG so i can compare it with the secret generated by my other device. Anybody know of a way to do this?
Asked
Active
Viewed 383 times
1
-
Did you end up solving this? The closest thing I could come up with is writing your own CNG provider that implements an "identity" hash... However that requires being an admin and placing a binary in system32, I'm looking for another way. – asveikau Mar 27 '14 at 16:56
-
Seems like the best way is to use a third-party solution instead of the MS crypto stuff. I've noticed CAPI/WinCrypt is similarly limited. – asveikau Apr 01 '14 at 17:54
1 Answers
-1
Take a look at CNG documentation at MSDN: NCryptSecretAgreement function. The same function is accessible from .NET.

wilkexx
- 113
- 1
- 7
-
This gives you a handle, not the actual session key. `NCryptDeriveKey` can give you a hash of it but not the actual value. The question unanswered here is how to retrieve the value. – asveikau Mar 27 '14 at 04:13