Because of china Great Firewall has blocked google appengine's https port. So I want to simulate a Secure Socket Layer by javascript and python to protect my users information will not be capture by those ISP and GFW.
My plan:
- Shake hands:
Browser request server, server generate a encrypt key k1, and decrypt key k2, send k1 to browser. Browser generate a encrypt key k3, and decrypt key k4, send k3 to server.
- Browse:
During the session, browser encrypt data with k1 and send to server, server decrypt with k2. server encrypt data with k3 and response to browser, browser decrypt with k4.
Please figure out my mistake.
If it's right, my question is
- how to generate a key pair in javascript and python, are there some libraries?
- how to encrypt and decrypt data in javascript and python , are there some libraries?