As a hobby project I'm thinking about how to write a secure chat where even all metadata are encrypted so that it is impossible to leak any (meta) information by design.
My basic idea is right now:
Each chat is split in blocks identified by an UUID just the last hex digit count up so that there are at max blocks of 16 messages. The first message of the block has some asymmetric encrypted information about this block like the AES key/iv (I'm not absolutely sure right now) encrypted for each chatter so that the other 15 messages have the same symmetric AES encryption (basically like GPG, I just encrypt up to 15 messages with the same symmetric key). The first message also keeps a reference to the previous block if there is one.
The first problem I see now is that based on the asymmetric part size that you can see the count of chatters. GPG should have the same issue right?
Now back to my real problem:
How can I encrypt securely without a tonne of encryption overhead basic data as received and read timestamps in a secure way so that the server cannot decrypt that information and nobody else can mark the message of someone else as read. Basically I just need to store 3 longs some kind of id and the two timestamps.