远程发布上的 PHP 和 mcrypt 安全性
嘿伙计们。 我正在尝试为网络服务创建一个应用程序商店,但我陷入了安全部分。 应用商店的主要思想是:在已经安装的平台上,用户可以安装主题、皮肤、示例内容或插件。 该过程将如下进行:
- 在后台,用户将单击安装按钮;
- 使用ajax,将调用本地服务器中的一个php函数,该函数将向主服务器进行远程POST,
- 该调用包含基于serialize(array('id'=>$unique_id,')的mcrypt密钥(MCRYPT_RIJNDAEL_128) url'=>site_url);
- 在远程服务器上检查参数,如果将唯一 id 分配给远程数据库内的指定 URL,则更新将被发送回
- 数据库内。无法访问 php 文件或无法访问数据库内存储的密钥,此外,用于加密数组的密钥存储在数据库内。
用户无法直接访问服务器。调用参数或调用详细信息的
安全性如何?
Hey guys.
I'm trying to make an appstore for a web service and i'm stucked at the security part.
The main idea for appstore is this: on the already installed platform, the user can install themes, skins, sample content or plugins.
The process will work like this:
- in the backed, the user will click on the install button;
- using ajax, a php function from the local server will be called and the function will make a remote POST to the main server
- the call contains a mcrypt key (MCRYPT_RIJNDAEL_128) based on serialize(array('id'=>$unique_id,'url'=>site_url);
- The arguments are checked on the remote server and if the unique id is assigned to the specified URL inside the remote database, the update will be send back.
- The $unique_id is stored inside the database. The user has no access to the php files or has no access to the keys stored inside the database. Also, the keys used to encrypt the array are stored inside the database.
The remote call is made from server to server. The user has no direct access to the call arguments or call details.
How secure is the entire thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜想唯一的 ID 可能是某种自动编号,可能会被某人猜到(可能并不总是如此)。如果你想要更安全,
进行某种加密并发送,从服务器端再次进行解密并检查这是否是有效条目并进行相应处理。
I guess the unique ID may be some kind of Auto Number, which may be guessed by someone (may not be always). If you want more secure,
do some kind of encryption and send, from the server side again do decryption and check whether that is a valid entry or not and process accordingly.