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

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


Date: Thu, 24 Feb 2005 02:43:08 GMT


>call taking 117 bytes as input and generating 128 bytes as output. What
are
>the extra 11 bytes? They cannot just be padding, it appears to us that
they
>contain information that is used by the cryptdecrypt call
Yes, you are right. In Windows 2000 and later, the encryption uses PKCS #1
Type 2 padding. On decryption, this padding is verified. The length of
plaintext data that can be encrypted with a call to CryptEncrypt with an
RSA key is the length of the key modulus minus eleven bytes. The eleven
bytes is the chosen minimum for PKCS #1 padding. The ciphertext is returned
in little-endian format.

Thanks,
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.



Relevant Pages

  • Re: Encryption using System.Security.Cryptography
    ... Since the first plaintext block doesn't have a preceeding encrypted block, ... Where ct1...3 are the resulting ciphertext blocks. ... >Subject: Re: Encryption using System.Security.Cryptography ... >the Padding property of the Rijndael class). ...
    (microsoft.public.dotnet.security)
  • Re: Crypto problems in Vista
    ... that weaken the encryption, as you then have multiple ciphertexts generated ... For CBC mode you can avoid padding by not passing TRUE for the Final ... and passing the duplicate key to the ... This causes the KP_IV of the original key to be ...
    (microsoft.public.platformsdk.security)
  • Re: random padding questions
    ... when performing asymmetric encryption and digital signatures with RSA. ... For padding schemes for symmetric encryption (those where there are ... The decrypting party needs only read the last byte to ...
    (sci.crypt)
  • RE: Encryption using System.Security.Cryptography
    ... During the encryption, your data is ... The size of each block is given by the BlockSize property of the algorithm being used, for Rijndael it's 128. ... unused portion of the second block is filled with padding, as specified in the Padding property of the Rijndael class). ... So, with PKCS7, a 32 byte message encrypts to ...
    (microsoft.public.dotnet.security)
  • Re: Blowfish encryption
    ... But your padding method will no doubt be useful for other ... encryption algorithms. ... klas dot engwall at engwall dot com ... The LFN Library for Clipper ...
    (comp.lang.clipper)