Re: Does AES_cbc_encrypt remove PKCS5 padding

2009-05-07 Thread Kenneth Goldman

I use that function, and it does not remove padding.

1 - How would it even know what is padding and what is your data?
2 - Why do you think it removes the padding?  The function does
  not return a length.

Here's a really wild guess:  Are you perhaps padding your data with
zeros and then using strlen() to determine the length of the result?

owner-openssl-us...@openssl.org wrote on 05/06/2009 05:53:27 PM:

 AngelWarrior srikanth.bemin...@gmail.com


 But I am experimenting with the code which is actually removing the
 padding by calling
 AES_cbc_encrypt(unsigned char*)input, (unsigned char*)(output),
  (const unsigned long)(length), ks,
 (unsigned char*)ivec, AES_DECRYPT).
 What is EVP layer?

 On Wed, May 6, 2009 at 3:45 PM, Dr. Stephen Henson st...@openssl.org
wrote:
 On Wed, May 06, 2009, AngelWarrior wrote:

  Hi,
 
  Does AES_cbc_encrypt add or remove the padding, if I provide an
un-padded
  data in the multiples of 16 bytes? I wrote a piece code where I am
manually
  adding the padding but when I decrypt using AES_cbc_encrypt the padding
is
  automatically removed.
 

 None of the low level cipher routines including AES_cbc_encrypt() add or
 remove padding. That is handled in the EVP layer.

Does AES_cbc_encrypt remove PKCS5 padding

2009-05-06 Thread AngelWarrior
Hi,

Does AES_cbc_encrypt add or remove the padding, if I provide an un-padded
data in the multiples of 16 bytes? I wrote a piece code where I am manually
adding the padding but when I decrypt using AES_cbc_encrypt the padding is
automatically removed.

-- 
_/\_
With Regards
SB Angel Warrior


Re: Does AES_cbc_encrypt remove PKCS5 padding

2009-05-06 Thread Dr. Stephen Henson
On Wed, May 06, 2009, AngelWarrior wrote:

 Hi,
 
 Does AES_cbc_encrypt add or remove the padding, if I provide an un-padded
 data in the multiples of 16 bytes? I wrote a piece code where I am manually
 adding the padding but when I decrypt using AES_cbc_encrypt the padding is
 automatically removed.
 

None of the low level cipher routines including AES_cbc_encrypt() add or
remove padding. That is handled in the EVP layer.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Homepage: http://www.drh-consultancy.demon.co.uk
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: Does AES_cbc_encrypt remove PKCS5 padding

2009-05-06 Thread AngelWarrior
But I am experimenting with the code which is actually removing the padding
by calling
AES_cbc_encrypt(unsigned char*)input, (unsigned char*)(output),
 (const unsigned long)(length), ks, (unsigned
char*)ivec, AES_DECRYPT).
What is EVP layer?

On Wed, May 6, 2009 at 3:45 PM, Dr. Stephen Henson st...@openssl.orgwrote:

 On Wed, May 06, 2009, AngelWarrior wrote:

  Hi,
 
  Does AES_cbc_encrypt add or remove the padding, if I provide an un-padded
  data in the multiples of 16 bytes? I wrote a piece code where I am
 manually
  adding the padding but when I decrypt using AES_cbc_encrypt the padding
 is
  automatically removed.
 

 None of the low level cipher routines including AES_cbc_encrypt() add or
 remove padding. That is handled in the EVP layer.

 Steve.
 --
 Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
 OpenSSL project core developer and freelance consultant.
 Homepage: http://www.drh-consultancy.demon.co.uk
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   majord...@openssl.org




-- 
_/\_
With Regards
SB Angel Warrior