Client-side encryption over HTTP with Diffie-Hellman Key Exchange and AES
After watching a YouTube video on the Diffie-Hellman Key Exchange , I wanted to try an implementation in JavaScript (Atwood's law). I sketched up an cipher on Node.js with the following rules: Step 1: Client and server agree on a shared key: Client & server start with a 512bit prime public key pK Client generates a 512bit prime private key kC and sends powMod(3, kC, pK) Server generates a 512bit prime private key kS and sends powMod(3, kS, pK) Client & Server use powMod(response, privatekey, pK) as the shared key Step 2: Communication Before a client sends data it is encrypted with the shared