使用 AMFPHP 框架通过 ActionScript 3 中的 PHP 安全连接 MySQL

发布于 2024-08-07 15:32:41 字数 196 浏览 2 评论 0原文

我的 Flash 电影想要与 MySQL 服务器通信,以在 MySQL 和 SWF 之间获取和保存数据。我知道 AMFPHP 可以帮助通信,但是有没有一种安全的方法来加密双方之间发送的文本(除了 MD5 中的散列密码)?据我所知,默认情况下,AMFPHP 以纯文本形式发送数据。

另外,我听说Flash中网络请求期间的CPU使用率相当高。有什么轻量级框架建议吗?

My Flash movie would like communicate with MySQL server to fetch and save data between MySQL and SWF. I know AMFPHP can help with the communication, but is there a secure way to encrypt the texts sending between 2 sides (other than hashing password in MD5)? As far as I know, by default, AMFPHP sends out data in plain text.

Also, I heard that the CPU usage during network requests in Flash is quite high. Any lightweight framework suggestion?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

反目相谮 2024-08-14 15:32:41

我实际上不太了解 AMFPHP,但一般来说,您永远不应该直接从客户端发送 SQL 查询。无论你的加密有多好,有人都可以破解它,然后他们可以对你的服务器做任何他们想做的事。

您应该在 PHP 中创建一个 API,客户端可以使用该 API 对数据库执行某些预定义的安全操作,因此如果有人对您的加密进行逆向工程(顺便说一下,通过反编译您的 swf 非常容易做到),他们只能对数据库执行允许的操作。

I don't actually know much about AMFPHP but in general you should never send SQL queries from a client directly. No matter how good your encryption, someone can break it and then they can do whatever they want to your server.

You should create an API in PHP that the client can use to perform certain pre-defined safe actions on the DB, so if someone reverse-engineers your encryption (which, by the way, is extremely easy to do by decompiling your swf), they can only do things to the database that are allowed.

生来就爱笑 2024-08-14 15:32:41

如果您想使用 Flash 进行游戏内购买,我认为唯一合理的做法是使用 SSL。你对此很便宜,但不希望你的客户也很便宜(也就是说,你希望他们为你的游戏付费,但你不会为他们的安全付费)。在我看来,这是相当不合理的。您只需保护交易部分(Flash 请求并将敏感数据发送到 https 网址...其余部分通过正常渠道)。

您可以四处寻找使用 Flash 的支付解决方案。我不会推荐定制的“加密”解决方案,因为您似乎不是安全专家。

请查看有关将 PayPal 与 Flash 结合使用的教程(尽管它不是AS3 但可以轻松转换,我还没有测试它,不确定这是否适合您的特定应用程序)。

顺便说一句,AMFPHP 可以处理二进制发送/接收。您还可以在给定时刻发送/接收所需内容,以便将 CPU 使用率保持在最低水平。

If you want in-game purchasing with Flash I think the only reasonable thing to do is use SSL. You are being cheap about it but don't want your customers to be cheap (that is, you want them to pay for your game but you won't pay for their security). Thats is quite unreasonable IMO. You would only secure the transaction part (Flash requests and sends sensitive data to an https url... the rest goes through normal channels).

You could look around for payment solutions using Flash. I wouldn't recomend a custom-made "encryption" solution since you don't seem to be a security expert.

Take a look at this tutorial on using PayPal with Flash (although it is not AS3 but can be easily converted and I have not tested it and am not sure if this fits your particular application).

By the way, AMFPHP can handle binary send/receive. You also send/receive what you need in a given moment so CPU usage can be kept at a minimum.

忘羡 2024-08-14 15:32:41

如果您希望在 Flash 应用程序和服务器之间建立安全链接,您可能只需要通过 SSL 部署应用程序,就像传统的 Web 应用程序一样。

If you want a secure link between the flash app and the server, you'll probably just need to deploy your application over SSL, as with a traditional Web app.

半仙 2024-08-14 15:32:41

对于安全登录和私人信息,SSL 在 Comodo 的价格非常实惠,价格为 39.90 美元,除此之外,如果安全要求不重要,为什么还要关心公开查看内容的哈希值呢。

为什么需要保护整个网站的安全?该网站仅包含 Flex/Flash 应用程序?

一个例子是使用 https 来保护用户在线交易:
https://www.singtelshop.com/

For secure login and private information, SSL is so affordable at $39.90 at Comodo, other than that, why care about hash your public viewing contents if the security requirement is not important.

Why do you need to secure your whole website? The website contain just a Flex/Flash application?

One example is this using https to secure user online transaction:
https://www.singtelshop.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文