Re: HCRYPTKEY from actual key bytes

From: lelteto (lelteto_at_discussions.microsoft.com)
Date: 06/22/05


Date: Wed, 22 Jun 2005 08:35:09 -0700

Yoy MUST send full blocks anyway so I don't understand your 'padding' issue
at all. The encrypted content MUST always be multiple of full blocks.
If your 'last chunk' is not full block than it surely cannot belong to an
encrypted block. You would need somebody else's help (MS?) to figure out
what's that last non-full-block chunk.

Laszlo Elteto
SafeNet, Inc.

"Levy" wrote:

> I am not sure I understand. I am decrypting the file's content by reading in
> blocks that are a multiple of the crypto algorithm's data block size, then I
> call CryptDecrypt with the final flag set to FALSE. The last data chunk of
> the file (which usually is larger than the data block size) is not a
> multiple of the data block size. I was passing this last block to
> CryptDecrypt, using TRUE for the bFinal flag. This last call fails.
>
> Now, are you saying that I also pass FALSE for the bFinal flag for this last
> block? But then, the data size of my last chunk should be a multiple of the
> algorithm's data block size (otherwise the operation fails, I think). Should
> I pad it? If yes, with what? And if I pad it, will it impact the decryption
> of the last few bytes of the file? I need to decrypt the entire file, even
> the last byte.
>
> Regards,
> Levente



Relevant Pages

  • Re: HCRYPTKEY from actual key bytes
    ... blocks that are a multiple of the crypto algorithm's data block size, ... multiple of the data block size. ... using TRUE for the bFinal flag. ... >> decrypting correctly because the IV is bad, ...
    (microsoft.public.platformsdk.security)
  • Re: HCRYPTKEY from actual key bytes
    ... My reading of the doc for CryptDecrypt was that on ... The encrypted content MUST always be multiple of full blocks. ... >> blocks that are a multiple of the crypto algorithm's data block size, ... >> call CryptDecrypt with the final flag set to FALSE. ...
    (microsoft.public.platformsdk.security)
  • Re: HCRYPTKEY from actual key bytes
    ... the decryption of the last block always fails (final flag set or not) ... The encrypted content MUST always be multiple of full blocks. ... >> blocks that are a multiple of the crypto algorithm's data block size, ...
    (microsoft.public.platformsdk.security)
  • [PATCH] ext2 : Use __func__ for function names in ext2_error messages
    ... "size of directory #%lu is not a multiple of chunk size", ... Off Intermediate Ring Road ...
    (Linux-Kernel)
  • VBA Consolidate Data
    ... I am looking for a chunk of code that will take a range of multiple ... cells and consolidate it into one cell seperated with commas. ...
    (microsoft.public.excel.misc)