I am trying to pass encrypted data from a Linux system to a Windows system. On the Linux system I am programming in C and using the libmcrypt library.
I am using Rijndael-128 in CBC mode and my code is based upon the example here https://gist.github.com/bricef/2436364 I am using a 16 byte key and a 16 byte IV. I have written the program which encrypts and then decrypts 16 bytes of ASCII text. I can see that the encrypted data is 16 bytes long.
Under Windows I am using VS2010 and C#. My code is based upon the example here. (first code block) Encrypting & Decrypting a String in C# except that I have changed this to pass the key, IV and data directly as byte arrays. I use the same 16 byte key and 16 byte IV as on the Linux system. I encrypt the same 16 bytes of ASCII text.
My test Windows program successfully encrypts and decrypts the data. However the encrypted text is 32 bytes with, strangely, the first 16 bytes being the same as the 16 bytes under Linux.
How can I achieve the same output on both systems?