Unconvinced. * Lossless UDP? Is there a reason not to do TCP? * There is no way to know if the public key is genuine, so the system is very sensitive to MITM. * The key exchange is inadequate. Why not do DH if it's just to have session keys? * The system is very easy to brute force as the acknowledgement is based on a known plain text. This is very bad . A quick glance at https://github.com/irungentoo/ProjectTox-Core…
>Lossless UDP? Is there a reason not to do TCP? Hole punching. >There is no way to know if the public key is genuine, so the system is very sensitive to MITM. If you want to add someone you need their public key (their id) which is 32bytes (It's small because we use ECC instead of RSA). Unless someone somehow replaces the key (your id) when you give it to your friend the system should be secure. >The key exchange is…
I ask why you don't use DH and you answer "because we want forward secrecy". DH has been designed for perfect forward secrecy. Therefore I fear we might have some sort of misunderstanding here.
You don't want to permit known plain text attack as "in depth defense" approach. If there is ever any weakness in your software, you want to make it very hard to exploit it. Known plaintext will make exploiting weaknesses in your PRNG very easy for example.
As for your last comment... If someone ever changes the behavior of read_packet, you're dead. So I'm sorry, but you have potential buffer overflow. Think in 4 dimensions Marty! :)