We're currently using https://pkg.go.dev/golang.org/x/crypto/nacl/box for p2p encryption (since it's easy), but Matrix already provides a strong encryption system that also includes key verification, a double-ratchet, etc.
Using Matrix's E2EE will also hide metadata about the election itself because all events will be of the type
m.event.encrypted, thus looking no different than normal matrix messages. Note that this isn't perfect opsec since the pattern of messages provides clues for eavesdroppers, but it helps.
In case I've screwed up the cryptography somewhere (or one or more of our dependencies has a bug), let's delete as many events as possible when an election concludes.
This will be among the features introduced in v0.4.0.
Unfortunately, it doesn't seem like it's possible to filter redaction events that only redact events that are not filtered: https://matrix.to/#/!NasysSDfxKxZBzJJoE:matrix.org/$l4ot1PPe1F86uB1sWkOpYOhVcMMURnFFjpq66obypCc?via=matrix.org&via=privacytools.io&via=amorgan.xyz
Hopefully v3 of the sync endpoint of the client-server API will fix this: https://matrix.org/blog/2021/05/14/this-week-in-matrix-2021-05-14#dept-of-spec-