Can RSA encrypted data be transmitted over HTTP?

My application encrypts data using RSA to send to a remote server via HTTP. Of course, the data is in the form of byte []. Is it safe to convert it to a string url encoded and sent in the request url? Or do you need to encode it?

+5
source share
2 answers

Yes of course. There is no RSA specificity; you are just loading binary data.

  • Sent to the GET request string: yes, you can encode the URL (or encode base64 and then encode the URL) provided it is not too long - some clients and servers have URL length restrictions.

  • ; POST , , , , , , URL-/ base-64-URL.

  • (multipart/form-data) POST. , , base64, . , , , .

+9

Base64, . Base64 Apache Commons Codec.

+2

All Articles