Hi All, This is Anil. I have few questions related to AES encryption:
------------------------------------------------------------------------------------------------------- 1. Does the size of encrypted data depends on the size of the plain text(considering plain text <= block size) ? Ex: If AES-128 is used to encrypt the data , input_data = 10 bytes input_data = 12 bytes Is it expected that encrypted data size is different in both the cases ? ------------------------------------------------------------------------------------------------------- 2. I am using the below mentioned api's to encrypt plaintext. I provide 16 byte AES key, 16 byte chunks of the input (tot length 64 bytes padded with zeroes if needed). Ideally the encrypted output len is 16 bytes for each block of input. In case of some inputs like (see below) the encrypted output is 13 bytes instead of 16. Input strings "ffffffff00000000000000000000" or ""ffffffffffffffffffff00000000". The same works fine for other string patterns that match the same length like "aaaaaaaa000..." Api's used <openssl/aes.h> AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); The AES_KEY used is 16 bytes and is set using AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); Key used 0102030405060708090a0b0c0d0e0f1f Is it expected ? ------------------------------------------------------------------------------------- Thanks -Anil