可以通过HTTP发送RSA加密数据吗? [英] Can RSA Encrypted Data be Sent Over HTTP?
问题描述
是的,当然。这里没有RSA特有的;您只是上传二进制数据。
-
在GET查询字符串中发送:是的,您可以对其进行URL编码(或base64 - 编码,然后URL编码),只要它不是太长 - 一些客户端和服务器具有URL长度限制。
-
您可以POST任何长度的数据;您可以将POST作为原始二进制,假设另一端可以处理它 - 即您可以绕过框架中将尝试将其解析为参数变量的部分,或者再次以URL编码/ base-64编码的URL编码。 / p>
-
您可以将其包装成文件上传(multipart / form-data)和POST。再次任何长度的数据,这将只是base64编码,所以可能会更短一些。它也将更容易集成到您的服务器应用程序框架中,因为它可能内置文件上传支持。
My application encrypts data with RSA to be sent to a remote server over HTTP. Of course the data is in byte[] form. Can it safely be converted to a string, url encoded, and sent in the query of the URL? Or does it need to be encoded?
Yes, of course. There's nothing RSA-specific here; you're just uploading binary data.
Sent in a GET query string: yes, you can URL encode it (or base64-encode it then URL encode it) provided it isn't too long - some clients and servers have URL length limits.
You can POST any length of data; you can POST as raw binary assuming the other end can handle it - i.e. you can bypass the parts of your framework that will attempt to parse it into parameter variables - or again as URL encoded / base-64-encoded-URL-encoded.
You can wrap it up as a file upload (multipart/form-data) and POST that. Again any length of data, and this will be base64 encoded only so might work out a bit shorter. It will also be easier to integrate into your server app framework as it'll likely have file upload support built-in.
这篇关于可以通过HTTP发送RSA加密数据吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!