RE: Crypto API and Not W2K problem



I may have found the problem. I thought it was related to the OS difference.
I now think it was a case of misusing the exchange key. I haven't been able
to test it yet but I think I have the answer.

I was encrypting the session key blob with my own exchange key and trying.
Then sending the PUBLICKEYBLOB to the other side to decrypt the the session
key blob. I think that the SIMPLEBLOB only encrypts with the public key from
the exchange key and only decrypts with the private key. As I wasn't sending
the private key the SIMPLEBLOB couldn't be decrypted.

Does that sound right?


--
Frank Perry
LavaLeaf Software


"Frank Perry" wrote:

> I'm trying to send data between Pocket PCs and W2K and not having any success.
>
> I need to exchange keys between the two. I have programs on both platforms
> that creates key blobs. When I copy them from one platform to another, they
> fail. The basic operation on both sides is:
> CryptAcquireContext
> CryptGenKey for the the exchange key
> CryptGenKey for the session key
> CryptExportKey for both - this is for testing. The real program will not
> send both keys
> Write the keys to a file
> Use the session key to encrypt the data
> Write the data to the file.
>
> The other end:
> Reads the exchange key blob
> Reads the session key blob
> CryptImportKey the exchange key
> CryptImportKey the session key
> Here it fails. I get a NTE_BAD_KEY error when I try it from one OS to the
> other. The program continues and decrypts the data correctly on the same OS.
>
>
> Any ideas? It's driving me batty. I'm using the Crypto API built in to
> both. Is there a difference that the documentation doesn't mention about the
> algorithyms they use?
>
> Any thoughts will be appreciated.
>
>
> --
> Frank Perry
> LavaLeaf Software
.



Relevant Pages

  • Crypto API and W2K problem
    ... CryptGenKey for the the exchange key ... Use the session key to encrypt the data ... Reads the exchange key blob ... CryptImportKey the exchange key ...
    (microsoft.public.pocketpc.developer)
  • Retrieve Public Key with CryptGetUserKey???
    ... I am currently creating a high level set of crypto functions based on the MS ... I have generated a Machine Container, an Exchange Key Pair (that will also ... Now I want to generate a session key and store it on the disk as a KEY BLOB. ... function) to get a handle to the Public Exchange Key and not the private ...
    (microsoft.public.security)
  • Retrieve Public Key with CryptGetUserKey???
    ... I am currently creating a high level set of crypto functions based on the MS ... I have generated a Machine Container, an Exchange Key Pair (that will also ... Now I want to generate a session key and store it on the disk as a KEY BLOB. ... function) to get a handle to the Public Exchange Key and not the private ...
    (microsoft.public.win2000.security)
  • Public Exchange key from cert
    ... I have got a test app that reads the recipient's public ... exchange key from a file and uses it to encrypt the ... session key. ...
    (microsoft.public.platformsdk.security)