[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-cryptoapi
Subject:    Re: AES key generation.
From:       SUBSCRIBE CryptoAPI Serge Yun <woon_ws () HOTMAIL ! COM>
Date:       2003-09-23 4:13:38
[Download RAW message or body]

hi,
  I m using WinXP SP1 and the CSP is the default windows CSP (Microsoft
Enhanced RSA and AES Cryptographic Provider (Prototype))
Below is the code:

PBYTE pbKeyLen = NULL;
DWORD dwCounts = 0;
HCRYPTKEY hSessionKey = 0;

if(!CryptGenKey(hProv, ENCRYPT_ALGORITHM,
CRYPT_CREATE_SALT|CRYPT_EXPORTABLE, &hSessionKey))
{
 printf("error");
 exit(1);
}
if(!CryptGetKeyParam(hSessionKey, KP_KEYLEN, NULL, &dwCounts, 0))
{
 printf("error");
 exit(1);
}
pbKeyLen = (BYTE *)malloc(sizeof(dwCounts));
if(!CryptGetKeyParam(hSessionKey, KP_KEYLEN, pbKeyLen, &dwCounts, 0))
{
 printf("error");
 exit(1);
}


On Mon, 22 Sep 2003 11:08:40 -0700, Dan Griffin
<dangriff@WINDOWS.MICROSOFT.COM> wrote:

>Dante, the handling of the KP_KEYLEN parameter for those three key
>algorithms should be exactly the same, so I'm surprised by your results.
>
>Which version of the operating system are you using, and which CSP?  Can
>you please include your CryptGenKey and CryptGetKeyParam code?
>
>Thanks,
>Dan Griffin [MS]
>
>-----Original Message-----
>From: Microsoft Cryptographic API
>[mailto:CryptoAPI@DISCUSS.MICROSOFT.COM] On Behalf Of SUBSCRIBE
>CryptoAPI Serge Yun
>Sent: Monday, September 22, 2003 3:06 AM
>To: CryptoAPI@DISCUSS.MICROSOFT.COM
>Subject: Re: AES key generation.
>
>
>On Tue, 3 Dec 2002 09:49:20 -0800, Laszlo Elteto <lelteto@RAINBOW.COM>
>wrote:
>
>>You should be able to do it under XP with the "Microsoft Enhanced RSA
>>and AES Cryptographic Provider (Prototype)" CSP. Use CALG_AES_256.
>>
>>Laszlo Elteto
>>Fellow Scientist
>>Rainbow Technologies, Inc.
>>
>>-----Original Message-----
>>From: Ciambella Dante [mailto:Dante.Ciambella@ELSAG.IT]
>>Sent: Tuesday, December 03, 2002 7:50 AM
>>To: CryptoAPI@DISCUSS.MICROSOFT.COM
>>Subject: AES key generation.
>>
>>
>>Hi guys,
>>anybody knows how can I generates a 256 bits AES (Rijndael) key, with
>Crypto
>>API?
>>Can I do it? Which API, and CSP I've to use?
>>
>>Thank you.
>>Dante
>>
>>----------------------------------------------------------------
>>Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
>>contains important info. Save time, search the archives at
>>http://discuss.microsoft.com/archives/index.html . To unsubscribe,
>>mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM
>>
>>----------------------------------------------------------------
>>Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
>>contains important info. Save time, search the archives at
>>http://discuss.microsoft.com/archives/index.html . To unsubscribe,
>>mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM
>
>Hi, i have tried to use CALG_AES_256 to gen a session key but when i
>tried to GetKeyParam, the KP_KEYLEN returned is NULL. Does tat mean that
>there is error witht the key? any solution for that? CALG_AES_128 and
>CALG_AES_192 seems to be alrite and return the correct KP_KEYLEN
>
>----------------------------------------------------------------
>Users Guide http://discuss.microsoft.com/archives/mailfaq.html
>contains important info. Save time, search the archives at
>http://discuss.microsoft.com/archives/index.html . To unsubscribe,
>mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM
>
>----------------------------------------------------------------
>Users Guide http://discuss.microsoft.com/archives/mailfaq.html
>contains important info. Save time, search the archives at
>http://discuss.microsoft.com/archives/index.html .
>To unsubscribe, mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM

----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:CryptoAPI-signoff-request@DISCUSS.MICROSOFT.COM
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic