Hello, > I tried the padding approach that I described in my prev mail. > But still no luck. I am concerned about the block size given by the > EVP_CIPHER_block_size. > > For example if I'm using 3-DES (block size=8)a buffer of size 64 to > call EVP_CipherUpdate and my plain text is of length let's say 117, > what should be the size of the pad for the last block? > Is it 11 (=N*64-117) OR 3 (=n*8 - 117)? > As I understood according to the specification > (http://www.w3.org/TR/xmlenc-core/ ) this should be 3. Of course.
> So I should have a suffix of XX3 where X can be any value. Yes. > Then I have another problem. > This padding will fill-up from places 126-128. How should I fill places > from 117 to 126? If you have cipher block size 8, and you have 117 bytes to encrypt than you use 3 bytes for padding data up to 120 bytes (15*8=120). So, now you have 120 bytes of padded data which means that this data is multiple of cipher block size. Now you starting encryption. If you choose to encrypt data in 64 byte chunks than first you call Update with 64 bytes and next with 56 bytes (rest: 120-64). Best regards, -- Marek Marcola <[EMAIL PROTECTED]> ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]