Encrypting messages without revealing length? In various messengers, we have end-to-end encryption, making it hard to know what the message said.
But do these messengers have to pad the message to some maximum length every time, in order to hide the length of the message?
In a block cipher, there is a minimum length that you have to pad to, right?
My question is how do WhatsApp, Telegram, and Signal actually do this? How effective are they are hiding the length of the message?
And are there good ways to hide this type of metadata (length of the message and how often it is being sent) by doing some sort of steganography (eg posting message chunks to different endpoints depending on a hash of some variables available only to the participants, and sometimes also posting decoy garbage prefixed with “disregard:” in order to obfuscate patterns, etc.)
This is a complementary answer to the Model Nest's answer, and will concentrate on how to achieve the constant size for messages. We assume that the files have confidentiality, integrity, and authentication while sending/ receiving.
First of all, in the security proofs like the CPA game, we assume the messages have the same length, otherwise, the advantage of the adversary is 1.
With 10 MB file limit

Encryption time
Here we assume that the application limits the message size to 10MB. This makes 10485760 bytes and therefore one needs 655360 AES encryptions per file.
If you have the AES-NI then the time is not the issue see AES-NI can reach 5.4107GB per second on my machine. That is far from the 10MB. Some ARM has the AES-NI instructions, and the performance is not included in this answer.

Sending time The 4G LTE

Download: 20Mbps and theoretical ones of 150Mbps and it will take 4 seconds with 20Mbps to download
Upload: 8Mbps on average and 50Mbps that will make 10 seconds to upload.



If the message size is fixed to 10MB then the chatting will be slow and people will start to complain. An alternative method is using two sizes if the leaked information that is the distinction of a message is sent or a file is sent then this is applicable.
Therefore here we can say that the limit does not come from the encryption time but due to the network speed. 5G calculations are not included.
Padding options

PKCS#7: When we talk about padding the first that comes to mind is the PKCS#7 padding. However, that is not applicable here since it can support up to 256 bytes since each byte represents the length of the padding.

Zero one padding: This is fine as long as the underlying Encryption algorithm is CPA secure and the (Key,IV) is not reused as in AES-GCM. If used this padding will produce a cheap reveal of some part of the messages. One can use a nonce misuses resistant scheme like AES-GCM-SIV or a faster version AES-PMAC-SIV to mitigate this problem.
SHA-3 padding is also applicable

ANSI X9.23 with a little extension this padding can be used; the last 32 bits can represent the padding size and the space between the data and size is filled with 0.

ISO 10126 This is similar to ANSI X9.23 except instead of filling with zero, random bytes are filled. This seems like the best candidate.


Results:

We can hide the length of the messages with a prefixed size.

The encryption time is not an issue if AES-NI is available.

The upload and download time can be the issue of chatting.
As a matter of the fact, constant size is achievable in secure message applications but not preferable for general users.