Re: Using CAPI to encrypt in AES CBC mode without padding



On Apr 27, 2:51 pm, "devenka...@xxxxxxxxx" <devenka...@xxxxxxxxx>
wrote:

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).

Devenkalra,

You can read the pkcs5 padding definition here:
http://www.rsa.com/rsalabs/node.asp?id=2124

CBC mode can be used without padding, or with padding, as you say.
However, it sounds like CAPI only provides you with the padding
variant, which means that you will always get >= 1 byte of padding.
You should check carefully in case you simply have not found the no-
pad variant. It is likely that the Sun stuff you were using provided
you with both methods. If you can't live with padding, you may have
to find another CSP to use with CAPI, or write your own... There is a
faint possibility that your CSP supports primitive single block AES
encryption, in which case you could easily roll your own CBC.

No doubt you realize that if you use no-pad CBC and you have data that
is not a whole number of blocks, then you are in trouble...

.



Relevant Pages

  • Re: Padding and block ciphers
    ... giving to each padding byte the value of the padding length (i.e. good ... If it's CBC mode, and the ... Your question seems to imply that you believe that plain encryption, ... use a mechanism which explicitly provides integrity, e.g., encrypt-then- ...
    (sci.crypt)
  • Re: Different cyphertext with rijndeal!!
    ... exactly same IV for the decryption process, so it must be stored with ... That means that before decrypting the cyphertext, ... What you are telling me is that if i use CBC mode i don't need to use ... padding nor add my own IV? ...
    (sci.crypt)
  • .NET ICryptoTransform and TransformBlock, TransformFinalBlock, Padding and CTS issues
    ... Now all the encryption is based on an ECB that requires an entire 8-byte ... (CTS), and end up with an 10 block output. ... Also, what happens if for exampe i specify i want to use CBC mode, and no ... What happens if i specify use CTS and padding? ...
    (microsoft.public.security)
  • 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: java.util.zip Limitations
    ... On Sun, 25 Apr 2004 15:32:10 GMT, Joseph Dionne wrote: ... The padding damaged ... ZipFile, uses TOC at end, allows random access - fast ... ZipInputStream, goes through entries sequentially, ...
    (comp.lang.java.programmer)