开发者

How do you encrypt data between client and server running in Flash and Java?

We have a multiclient system where the client is written in Flash and the server is written in Jav开发者_开发问答a. Currently, communication is done in Flash by usage of flash.net.Socket and the protocol is written in JSON. The server uses a custom port to receive connections and then proceed to talk with each client. As expected, data is sent and received on both fronts as raw bytes, which are then decoded as needed.

We would like to encrypt the communication between clients and server. I have some basic understanding about public/private key encryption, but I do not know what is the best way to exchange keys or what libraries are available (on both languages) to do this.

What would be the best strategy to attack this problem and where should I start looking for libraries/methods to implement this encryption?


No need to reinvent the wheel. Use ssl/tls. There's an as3 ssl implementation that we've used in several commercial projects. Make sure you create a root cert store for the as3 component and populate it with at least the root ca for your server cert. On the server, use java's built in ssl server socket.

Alternatively, you could do away with the custom server, if this is at all possible, and use https, kind of like you would with Ajax in HTML/JavaScript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜