Confused by CryptoAPI
- From: nde_plume@xxxxxxxxxx
- Date: 21 May 2006 13:35:59 -0700
I have been looking at the CryptoAPI for a while and remain a little
confused as to how it all plugs together. Basically, what I want to do
is:
1. Client asks in clear for a public key from server, and server sends
it
2. Client generates a symmetric key on a client, encrypts it with a
public key and send this to the server.
3. The server decrypts this, and signs the key with the private key,
and sends it back to the client.
4. The client verifies the signature.
5. Now client and server communicate over the symmetric key generated
in 2 above.
This seems pretty straightforward to me, however, the CryptoAPI seems
like a maze of complicated options. The functions I need are:
Generate a public key
CryptGenKey I believe
Get a clear representation of the key that can be loaded on the client
end
Seems to be CryptExportKey but not sure
Generate a symmetric key
CryptGenKey I think, but how does this differ from generating an
asymmetric key?
Encrypt data with a public key
CryptEncrypt I think, but I am not sure if it uses the symmetric key
or the asymmetric key
Sign data with private key
CryptSignHash
Verify data with public key
CryptVerifySignature
Encrypt and decrypt with symmetric key.
Again, not sure, is this CryptEncrpyt and CryptDecrypt -- which key
does it use?
Where my confusion is, is that the API seems to put asymmetric and
symmetric keys into one function, and I am not sure what does which.
For example, when I call CryptEncrypt does it encrypt with the
symmetric key or the public key? When looking at the service provider
types, each one specifies both asymmetric crypto and symmetric. Which
does it use?
MY head hurts, any help would be much appreciated.
.
- Follow-Ups:
- RE: Confused by CryptoAPI
- From: lelteto
- RE: Confused by CryptoAPI
- Prev by Date: Re: Encryption API Question
- Next by Date: Registered PKCS#11 drivers
- Previous by thread: Re: Encryption API Question
- Next by thread: RE: Confused by CryptoAPI
- Index(es):
Relevant Pages
|