Re: CPSetKeyParam question



Hi Tom,

In CryptoAPI, when a CSP receive a call to CPSetKeyParam with KP_IV param,
the only parameter used to set the initialization vector of the key is
BYTE
*pbData. How the CSP know pbData's lentgh ? Because when an application
calls
CPGetKeyParam wtih pbData=NULL, the CSP retrieve the length of the key
IV...

Initialization vectors are used in block cyphers and are always the size of
one block. Since CPGetKeyParam works on a key, a particular encryption
algorithm and key size is associated with the key, and therefore also a well
defined block size.

This is analogous to the CPSetHashParam function with the HP_HASHVAL
parameter: The size of the hash is determined by the type of the hash and
isn't passed with the function.

Best regards,
Jan.


.



Relevant Pages

  • RE: Sign and Verify with Different CSPs
    ... Unlike an RSA signature, which is a BIG NUMBER - and, hence, byte order is ... the purpose of the program was to test my CSP. ... What still confuses me is that the hash my CSP produces is also in big ... As for the public key: when you use CAPI to export the public key, ...
    (microsoft.public.platformsdk.security)
  • RE: CryptSignHash with SHA2, hash size and OID
    ... you can't force a CSP to use a hash of a unsupported ... There are smart card CSPs that support SHA-256 on the market, ... this with CryptSignHash. ...
    (microsoft.public.platformsdk.security)
  • RE: CryptSignHash with SHA2, hash size and OID
    ... sign with a hash algorithm that the card CSP does not support. ... ..NET I wanted to use the native counterpart (CSP). ... and again the problem is same, how am I going to modify hash algorithms. ...
    (microsoft.public.platformsdk.security)
  • RE: Using more powerful hash function with CAPI
    ... As you noted both signing and verification require the hash and key HANDLES. ... Although you can create a hash in one CSP and transfer the hash VALUE into ... > attacks on hash algorithms, it's becoming all the more desirable for MS ...
    (microsoft.public.platformsdk.security)
  • RE: Sign and Verify with Different CSPs
    ... the purpose of the program was to test my CSP. ... My CSP uses big endian representation for byte arrays. ... What still confuses me is that the hash my CSP produces is also in big ... As for the public key: when you use CAPI to export the public key, ...
    (microsoft.public.platformsdk.security)