This far, we have mostly been concerned about encrypting file data and file names, but leaving file sizes and timestamps as they are. The reason for this is that file sizes and timestamps have rarely ever been used in practice to identify what file it is.
However, the situation appears to be changing, as some governments are now calling for and even planning to fund development into tools that can detect illegal content (such as CSAM) despite it being encrypted. Both on disk and in transit. Although they haven't said how they intend to do it, using the unencrypted file sizes, file counts and timestamps are likely vectors they will target.
This can of course not detect the content of unknown files, such as encrypted private photos, but file sizes in bytes are usually unique enough that it would reveal the content of a known file, even if the content has been wrapped with unbreakable encryption. There are probably very few files in the world that would be exactly 5682334 bytes large, and if there is a set of files, the set will definitely be uniquely identifiable, despite encryption. Likewise, oftentimes, apps that download files also fetch the file timestamp from the remote server, and might also share the timestamp when sharing the file. There is probably not very many files that were created exactly 9th August 2025, 11:33:04. Thus the timestamp essentially becomes a unique identifier for the file, especially if there are timestamps for a set of files that belong to each other.
Protecting against leaking the identity of the file is easy: When sending the file over a messenger, do not send a timestamp, and pad the encrypted file so its size matches that of many other padded files, and if sending many files together, zip them before padding to hide file count and approximate sizes for a set of files.
This can be very important when sharing sensitive files that are or will be known to the adversary, such as sensitive leaked documents (whether you are the original source or not), video recording of human rights abuses, and so on.
But I don't know any messenger that actually does pad file sizes. Are there any messenger that does?