Does AES (128 or 256) encryption expand the data? If so, by how much


I would like to add AES encryption to a software product, but am concerned by increasing the size of the data. I am guessing that the data does increase in size, and then I'll have to add a compression algorithm to compensate.

Best Solution

AES does not expand data. Moreover, the output will not generally be compressible; if you intend to compress your data, do so before encrypting it.

However, note that AES encryption is usually combined with padding, which will increase the size of the data (though only by a few bytes).