SpyrexDE / NetChat

GNU General Public License v3.0
1 stars 0 forks source link

Insecure RSA key exchange #1

Open Antricks opened 3 years ago

Antricks commented 3 years ago

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...

Antricks commented 3 years ago

TLS without using a trusted third party would have the same problem.

Antricks commented 3 years ago

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".

Antricks commented 3 years ago

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"

Antricks commented 3 years ago

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.

Antricks commented 3 years ago

Here's more material to read: https://security.stackexchange.com/questions/237263/rsa-key-exchange

Antricks commented 3 years ago

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...