RSA encryption between jQuery/JavaScript and C++

This project was successfully completed by andreygalysh for $300 USD in 3 days.

Get free quotes for a project like this
Project Budget
$250 - $750 USD
Completed In
3 days
Total Bids
Project Description

We need C/C++ code and compatible jQuery/JavaScript code that will work together to enable RSA-encrypted communication between a Microsoft C++ executable and a web client. The C/C++ code must compile under Visual Studio 2008, possibly using MFC but with no dependency on .NET. Our application will work as follows:

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

We have no problem implementing the Ajax communication and having the EXE manage a map of stored keys and pending requests. But we haven't figured out how to write a matching pair of RSA routines in C/C++ and JavaScript that will work together. Specifically, we need:

1. C or C++ code that creates a public/private key pair for RSA.

2. JavaScript that uses the public key exactly as created by the C++ to encrypt a string.

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.



Completed by:

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online