简体   繁体   English

在RaspberryPi / USB中保护PHP代码

[英]Secure PHP code in RaspberryPi/USB

I have a online project working fine, but a customer ask me if it was possible to sell him the project but in a offline environment, mainly because he has trust issues with internet. 我有一个在线项目工作正常,但客户问我是否可以向他出售项目,但在离线环境中,主要是因为他有互联网的信任问题。

If the internet in his company goes down, the entire company would stop because of it and therefore he would like a offline solution. 如果他公司的互联网出现故障,整个公司都会因此而停止,因此他想要一个离线解决方案。 I don't want to write a windows application from scratch because the project is too big and the time lost wouldn't compensate. 我不想从头开始编写Windows应用程序,因为项目太大而且时间损失也无法弥补。


So I thought about put the project in a RaspberryPi or USB with Server2Go server embbed. 所以我考虑将项目放在带有Server2Go服务器的RaspberryPi或USB中。

Problem : How do I secure access to the code and database? 问题 :如何保护对代码和数据库的访问?

As I understand, you do not want your code / database to be read through any file access protocol. 据我了解,您不希望通过任何文件访问协议读取您的代码/数据库。

With PHP, it will be hard to obtain. 使用PHP,很难获得。 You could obfusctate your code... but, believe me, it is not the right solution. 你可以忽略你的代码......但是,相信我,这不是正确的解决方案。

See here: Is there a code obfuscator for PHP? 请参阅: PHP是否有代码混淆器?

When selling code based on Open Source languages, the solution is perhaps in providing services. 在销售基于开源语言的代码时,解决方案可能就是提供服务。

Edited after comment 评论后编辑

By default, the Raspberry Pi is accessible using pi / raspberry credentials. 默认情况下,可以使用pi / raspberry凭证访问Raspberry Pi。 You'll just have to change the default password to a new one using this command 您只需使用此命令将默认密码更改为新密码即可

passwd

Files and DB will only be served through webserver. 文件和数据库只能通过网络服务器提供。

First i don't know about locking the web folder and prevent them from looking into it but.. 首先,我不知道锁定Web文件夹并阻止他们查看它,但..


As most of Applications do, read these steps: 与大多数应用程序一样,请阅读以下步骤:
- First the Legal protection: - 首先是法律保护:
1- make a Contract with a good lawyer to protect your work and money 1-与一位优秀的律师签订合同,以保护您的工作和金钱
2- Register your source code in a Rights Protection organizations. 2-在Rights Protection组织中注册源代码。
- Second Source Code protection: - 第二源代码保护:
1- usually depending on JAVA or C#.NET for the Compiler to byte code or lower and its VM sandbox / Framework. 1-通常依赖于JAVA或C#.NET编译器到字节代码或更低版本及其VM沙箱/框架。 but in PHP it's an interpreter language that supports open source. 但在PHP中,它是一种支持开源的解释器语言。
2- you can mix Java/c# with php by making a small web application to link the server hardware serials (like hdd / motherboard serial / available mac address / Operating system installation date) in encrypted hidden place to prevent stalling your files to run on another machines. 2-你可以通过制作一个小的Web应用程序将Java / c#与php混合,将服务器硬件序列(如hdd /主板串行/可用的mac地址/操作系统安装日期)链接到加密的隐藏位置,以防止文件停止运行另一台机器。


3- Mixing PHP with a compiled language means also to make part of your site (logics) in a compiled language and the php are depends on it so you'll prevent coping them by normal way. 3-将PHP与编译语言混合也意味着以编译语言构建您的站点(逻辑)的一部分,而PHP依赖于它,因此您将防止以正常方式处理它们。


4- you can buy a Dongle usb for the previous purpose like (sindbad protection) 4-你可以为以前的目的买一个加密狗usb(sindbad保护)


5- Encrypt the remaining part of your PHP files for less secure to prevent the read of them using one of those tools 5-加密PHP文件的剩余部分以降低安全性,以防止使用其中一个工具读取它们
A) free and working PHP obfuscators: A)免费和有效的PHP混淆器:

http://www.pipsomania.com/best_php_obfuscator.do http://www.pipsomania.com/best_php_obfuscator.do

http://www.phpprotect.info/ http://www.phpprotect.info/

B) Encode the source files by one of them: B)通过以下方法之一对源文件进行编码:

http://php.net/manual/en/function.blenc-encrypt.php http://php.net/manual/en/function.blenc-encrypt.php

http://www.showmycode.com/ http://www.showmycode.com/

http://phpshadow.com/ http://phpshadow.com/

http://dezender.net/ http://dezender.net/

http://www.zend.com/en/products/zend-guard http://www.zend.com/en/products/zend-guard

http://www.ioncube.com/php_encoder.php http://www.ioncube.com/php_encoder.php

May be php would not work since it requires a webserver to run. 可能是php无法运行,因为它需要运行Web服务器 As rpi supports python try django, web2py or even jinja2 由于rpi支持python尝试django,web2py甚至jinja2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM