Re: export keys

lelteto wrote on 15/02/2008 18:30:
1. He clearly wraps the key (because uses the key handle from GetUserKey in CryptExportKey). Getting out a symmetric key value is tricky: although in newer OSes one can use PLAINTEXTKEYBLOB, in older CAPIs one would need to use the "exponent one" method - which is not fun...

indeed he wraps it, but again I think he doesn't want to.
CryptExportKey use is likely a mistake.

2. as for your question: CryptDeriveKey simply uses the current HASH VALUE in a deterministic way. So if you always input the same data (eg. password) into CryptHashData, you will always get the same has value, and hence, the same derived key. That IS the whole point of deriving key from some data - that two sides can derive the SAME key.

ok, of course both sides (using same CSP) will / must generate the same key. but my question was: what "deterministic way" is used ?

since no diversification parameters are providers, I assume that either the key material is exactly the data transmitted as parameters, or a kind of derivation is done, derivation that, at least, is not documented by the API's name. what is the right ?