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.

  • Before going further, did you read the signal protocol?
    – kelalaka
    Sep 30 at 7:01
  • I know the app, but I never checked their encryption. I'll check what I can find out.
    – rekire
    Sep 30 at 7:15
  • Thank you a lot for this hint, that will likely improve my crypto a lot. But I'm still not sure how I should encrypt my metadata. The details I found also left out how group chats work in Signal and WhatsApp
    – rekire
    Sep 30 at 19:29
  • Signal doesn't store much meta data. if you are not accessible, once you get your message, the message on the server is deleted. Signal server leaves minimal footprint of the clients. Maybe this help Is Signal still more secure than WhatsApp?
    – kelalaka
    Sep 30 at 19:39
  • Ha, that makes absolutely sense, but this impotent for my use case. However why should my server hold all messages forever, a reasonable time span would be fine and when you did not read your messages e.g. for a month they are lost... However even that creates metadata. I see a circle in my toughs
    – rekire
    Sep 30 at 19:40


You must log in to answer this question.

Browse other questions tagged .