dtncv04228 2014-02-15 19:36
浏览 35

PHP加密隧道可能吗?

I have a situation where I need my Windows Phone 8 app to communicate with my PHP server in a secure fashion. My initial thought was to use SSL and I got all my server side code working with a self-signed certificate and me just interfacing with it through my browser but when I started coding the WP app I discovered self-signed certificates are not supported by Windows Phone app SSL and I cannot afford to pay for a proper certificate for this project.

The plan I came up with is to use a sort of PHP encryption tunnel to let the app interface with the pages. What I mean is that say the request would have been "https://sub.mysite.com/mypage.php?param=value" now what I do I have a page called crypt.php and I request "http://sub.mysite.com?crypt.php?request=encryptedrequest" where "encryptedrequest" equals the RSA encrypted version of "mypage.php?param=value". The crypt page should then decrypt the request, request it locally, encrypt the result echoed by the other page and then send the encrypted result back to the app which can then decrypt it.

Getting info for using RSA on PHP and C# should not really be a problem and I can package the app with the public key for the server and vice versa so that part should not be a problem.

Unfortunately though I am a very inexperienced PHP developer and have no idea if it is somehow possible to request another PHP page on the localhost from a PHP page and then capture the echoed result, I am also struggling to find any information regarding this. Any help would be greatly appreciated.

PS. If you happen to have any info on RSA encrytpion on C# and/or PHP it would also help...

EDIT: Ok I have now sort of implemented this with http://phpseclib.sourceforge.net but the performance knock of using this instead of native SSL is just ridiculous, is there not some library that I can use to perform the cryptography more natively on my linux server?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 R语言Rstudio突然无法启动
    • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
    • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值