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

Bob Kuhl picture Bob Kuhl · Sep 18, 2008 · Viewed 34.6k times · Source

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.

Answer

moonshadow picture moonshadow · Sep 18, 2008

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).