1

I want to encrypt some vars in js code and pass them to server side (Python). How can I implement this? Thanks in advance!

2
  • Well, there are some sensitive information that needs to be encrypted. Or should I pass already encrypted code to client side? Commented Jun 10, 2011 at 9:06
  • 1
    Use transport layer encryption (i.e. SSL). Commented Jun 10, 2011 at 9:28

2 Answers 2

4

Activate HTTPS on your server and all communication between the browser and your server will be encrypted, and you won't need to do any additional work in your code.

How you do this depends on what webserver you're using.

Sign up to request clarification or add additional context in comments.

Comments

1

HTTPS is definitely the way to go. However, if for whatever reason HTTPS is unavailable (e.g., you're on google app engine with a custom domain), you can try jCryption on the front-end and pyCrypto on the server.

An advantage is that you do not need to buy an SSL certificate or deal with certificate administration. A disadvantage (and it's a big one) is that it is very easy to get encryption wrong and expose your site to security vulnerabilities. Also, without a certificate your site is still vulnerable to certain types of attacks. So make sure you know how the encryption works and proceed with caution.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.