Hi there ,
I'm trying to use the AES Class within Visual C#
While coding a message, it occcured to me that trying to encode a 16 bytes Block message with AES give 2*16 bytes encrypted blocks ( like my message was 32 bytes long).
It does the same for 2* 16 bytes blocks messages, where 3*16 bytes encrypted blocks are returned.
I'm using an IV and a key of 16 bytes (128 bits).
If i send 15 bytes, the encrypted message turns back to 16 bytes again ( 15 bytes message + PKCS Padding realised internally within the class)
Inside the AES specification document, it is not clarly stated if a char is added to endup the message , before realising the padding , but i suspect this to be the case , which would explain why my 16 bytes message would in fact be postponed with a termination char , and then the padding added to make it a 32 bytes message.
I read somewhere (but dont remeber the source) that before padding the message, it is recommended to add 0X80 at the end of the message.
Could someone help me to clarify why i observe the described behaviour ( 2 encryption block with one message block) ?
thanks,
Eric
What I have tried:
please see above for the description of the problem.