Using 128 bit AES (CALG_AES_128) to generate session keys - problem

From: Dale R (daler1_at_rediffmail.com)
Date: 05/26/04


Date: 25 May 2004 19:57:33 -0700

Hi,

Im using Visual Studio 6, Ive installed the latest version (or close
enough) of the Microsoft Platform SDK. Im running this on Windows XP.

My problem arose when trying to use CryptGenKey to generate a 128 bit
session key using the AES algorithm. What happens is that the context
acquiring, container, all the standard calls go through fine. But only
in the case of CALG_AES_128, the CryptGenKey() call fail with
NTE_BAD_ALGID. With CALG_RC4 it goes through just fine (and works!).

So my question is, what could I be doing wrong? What might I need to
do to get this to work? Is it perhaps a problem with the way I
installed PSDK?

My call to CryptGenKey is as follows
CryptGenKey(hProv, ENCRYPT_ALGORITHM, CRYPT_EXPORTABLE, &hSessionKey)
 where ENCRYPT_ALGORITHM is #defined to be CALG_AES_128.

Any assistance is greatly appreciated! Ive gone through MSDN very
heavily and it was very useful to do the basic coding, but handling
these odd cases is something I just couldnt do from what I got there.

Thanks!



Relevant Pages

  • Re: Using 128 bit AES (CALG_AES_128) to generate session keys - problem
    ... PROV_RSA_AES as provider type. ... > enough) of the Microsoft Platform SDK. ... > My problem arose when trying to use CryptGenKey to generate a 128 bit ...
    (microsoft.public.platformsdk.security)
  • Re: Need XP Help
    ... feature in Windows XP ... If that works try using System Restore to restore the system to a point ... before the problem arose. ... Windows could not start because of an error in the software. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Some applications wont connect to the internet
    ... Compliments of Steve the Moderator (Windows Vista God): ... Internet Explorer 64Bit works and Internet Explorer ... Firefox, MSN, and Ventrilo are all 32Bit and no longer work. ... This problem arose about a week ago - after an update. ...
    (microsoft.public.windows.vista.general)
  • can not save altered files over network
    ... However, a separate ... problem arose - bit of history below: ... I uninstalled the Windows XP update KB885250 and that removed the problem. ...
    (microsoft.public.excel.misc)