- JS sends an Ajax request to the EXE asking for an RSA public key.
- EXE creates a public/private key pair, remembers the private key, and returns the public key as the Ajax response.
- JS uses the returned public key to encrypt a password and sends the encrypted password to the EXE via a second Ajax request.
- EXE decrypts the password using its stored private key, then validates the password and returns VALID or INVALID to the JS.
1. C or C++ code that creates a public/private key pair for RSA.
3. C or C++ that decrypts the string sent by the JS using the corresponding private key that it created.
Obviously, the JS and C/C++ code have to work together. When the EXE decrypts the password using the private key it created, the result must match the original string that JS encrypted using the public key that the EXE sent it.
Best would be a simple C++ project and web page that interact this way - C++ creates keys, JS encrypts, C++ decrypts, and the result matches the original string.
9 freelancers are bidding on average $641 for this job
I think I can do this based on my previous experience on RSA encryption. I am not yet 100% sure though. Is JS part for a specific browser or general (you want it to work in all browsers)?