RE: Decryption using private key from cert store failing with err

From: Rhett Gong [MSFT] (v-raygon_at_online.microsoft.com)
Date: 02/16/05

  • Next message: Rhett Gong [MSFT]: "Re: Testing Applying Microsoft Gina patches to a Gina Replacement"
    Date: Wed, 16 Feb 2005 03:14:53 GMT
    
    

    >I tried changing my datasize to 117 and still get the bad data return. I
    >also do not know why you recommended adding the cryptencrypt call.
    >I am trying to implement part of the SSL protocol, and it requires that I

    And if you have encrypted string as the input for your code, then calling
    CryptDecrypt with proper key or hash value should work as expected.
    However, from your first post. what I got was that you were trying to
    decrypt a plain string which has 128 'A's. Though the buf is just a stream
    of bits and meanless, but if you want want to decrypted with alg&key you
    define, they must be valid for the decrypt process, otherwise, CryptDecrypt
    will fail and you may get NTE_BAD_DATA as last error.
    Since your code looks like a test sample, that is why I suggest you add
    encrypt code to see how it works.
    PS, the code works fine in my side, have you changed MY_DATASIZE 0as
    follows?
            enum
            {
                    MY_BUFSIZE=(32*1024)
                    ,MY_DATASIZE=(117)
            };

    Thanks and Regards,
    Rhett Gong [MSFT]
    Microsoft Online Partner Support
    Get Secure! - www.microsoft.com/security

    This posting is provided "AS IS" with no warranties and confers no rights.


  • Next message: Rhett Gong [MSFT]: "Re: Testing Applying Microsoft Gina patches to a Gina Replacement"

    Relevant Pages

    • Re: Trial period for app
      ... or in a field in a Table and compare it with Nowin startup code, ... encrypted string in the Registry and the other in a Table field. ... decrypt identically, do the time check as before. ...
      (microsoft.public.access.modulesdaovba)
    • Re: How can I encrypt the password stored in a database table ?
      ... "Alex Nitulescu" wrote in message ... > produces an encrypted string for use in a config.xml file. ... > Anyway, even if I wanted to use this one, how do I reverse it (decrypt it) ... > The second question would be how do I get my application's name? ...
      (microsoft.public.dotnet.framework.aspnet)
    • Error 0x8009000f on second time calling CryptAcquireContext()
      ... decrypt my data with CryptDecrypt() ... I also get this error on the first aquire when I restart the app. ... Of note is this happens on my WinCe device but works fine on my ...
      (microsoft.public.platformsdk.security)
    • Re: Newbie question about AES encryption
      ... initializing the cipher with a SHA1 hash of the password, ... I try and decrypt ONLY PART of the encrypted string, ... Remember that secrecy and authentication are independent ...
      (sci.crypt)
    • Rijndael decryption with wrong key fails
      ... when I try to decrypt an encrypted string using a wrong ... key and the Rijndael algoritm I get a strange error. ...
      (microsoft.public.dotnet.framework.aspnet.security)

  • Quantcast