Re: Using CAPI to encrypt in AES CBC mode without padding
- From: "devenkalra@xxxxxxxxx" <devenkalra@xxxxxxxxx>
- Date: 27 Apr 2007 14:51:48 -0700
On Apr 27, 12:19 pm, Mike Amling <nos...@xxxxxxxxxx> wrote:
devenka...@xxxxxxxxx wrote:
I am trying to use CAPI to write a function for encryption in AES mode
using CBC mode. My understanding was that if the input buffer
(plaintext) is a multiple of 16 (block size), then the length of
encrypted text should be the same. However what I find is that
if input buffer size is 32, encrypted is 48
if input buffer size is 512, encrypted is 528
if input buffer is 31, encrypted is 32
That is, if the input is not a multiple of 16, output is rounded to
multiple of 16 but if the input buffer is multiple of 16, the output
buffer has 16 extra bytes.
Is there a way to get the encrypted text to be same length as input
text if input buffer size is a multiple of 16.
What kind of padding did you ask for or default to?
--Mike Amling- Hide quoted text -
- Show quoted text -
The default in MSCAPI is to use PKCS5 mode padding. I don't know what
that means. Basically I want to use no padding. Basic CBC mode
encryption should let me do that. In fact, on solaris using the Sun
Cryptographic Framework, I get exactly that (size of output buffer ==
size of input buffer).
Deven
.
- Follow-Ups:
- Re: Using CAPI to encrypt in AES CBC mode without padding
- From: Mike Nelson
- Re: Using CAPI to encrypt in AES CBC mode without padding
- References:
- Using CAPI to encrypt in AES CBC mode without padding
- From: devenkalra
- Re: Using CAPI to encrypt in AES CBC mode without padding
- From: Mike Amling
- Using CAPI to encrypt in AES CBC mode without padding
- Prev by Date: Re: crc32 - couriuos question
- Next by Date: Re: Using CAPI to encrypt in AES CBC mode without padding
- Previous by thread: Re: Using CAPI to encrypt in AES CBC mode without padding
- Next by thread: Re: Using CAPI to encrypt in AES CBC mode without padding
- Index(es):
Relevant Pages
|
|