So one day i was reading about RSA and over there it was written that we can secure the data using the public key. So as an idea can I secure the data on the client itself before sending it to the server using the public key provided. And decrypting using the private key on the server?

  • There is more to securing data than making sure only the server can read it. There is also prevention of spoofing. Commented Feb 2, 2017 at 13:53
  • 3
    Without threat-model it's hard to judge what "secure" means for you. But probably you should use TLS instead of working with RSA yourself. Commented Feb 2, 2017 at 13:57
  • Since the client computer is not under your control, you should assume that it will be hacked (& any private keys will be discovered). Design your system accordingly. Commented Feb 2, 2017 at 15:14

1 Answer 1


This is what https:// was designed to do. A client/server connection via https is already encrypted (via TLS) using a unique, mutually created key pair. You'll want to configure the most robust cipher that your server supports with failovers to lower-grade (but not too low) ciphers if some of your clients need that support.

  • Yes I get it, but I have an AWS server and that I want to host apps on it without https. I just wanted to use my own expertise.
    – Nilesh
    Commented Feb 3, 2017 at 9:27
  • What protocol will you use, if not https?
    – WillD
    Commented Feb 3, 2017 at 15:51
  • Will plan to use normal http but will send encrypted data using RSA. Will that work?
    – Nilesh
    Commented Feb 3, 2017 at 16:03
  • The confusion here is that https:// IS pretty much "RSA" (Asymmetric key encryption) with http://. If you want to build this yourself, you can, but: - someone's already done it for you - There's man-millennia of testing and debugging already done - It's free - It's a standard, and compatible with just about everthing - no offense, but you probably won't do as good a job, and neither would I If you want to take this on as an exercise, great. Otherwise, IMO you'd wasting time that would be better spent else where.
    – WillD
    Commented Feb 3, 2017 at 17:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.