Open Antricks opened 3 years ago
TLS without using a trusted third party would have the same problem.
The server could be evil too, as it controls the public RSA keys of other users. It would be extremely easy to craft a server that MITMs the RSA keys and thus would break "end to end encryption".
I think I'll need to study this here: https://signal.org/docs/ At the moment our system is totally scuffed and should not be trusted. How did I think this was a working solution. My monkey brain probably went like "Ooh ooh ahh ahh SSH use RSA - RSA secure as fuck"
But that's what this project is for - me learning how stupid I am when it comes to crypto... Hopefully, we'll get to something that can at least kind of be trusted in the future.
Here's more material to read: https://security.stackexchange.com/questions/237263/rsa-key-exchange
Also what if the RSA private key gets leaked somehow? At the moment I'm using the same key pair for ID and for encryption. This is brutally wrong. We'll need some kind of rekeying. I wonder how OpenSSH does that though... I mean they pretty much have the same problem as we have when it comes to leaked private rsa keys. Their files seem to be named id_rsa for some good reason. Time to deep dive into OpenSSH's encryption too...
At the moment an intercepting MITM could manipulate the RSA key exchange to gain full control of the traffic (both client ---(evil)---> server and client ---> server (evil) ---> client), fully breaking the encryption. Further problems listed below...