search

记得我有个非常好的朋友曾经向我大倒苦水,原来他加了半个月的夜班,给别人开发了一套PHP程序,结果遇到了奸商,人家收了源代码说是先测试,然后就消失不见了,电话打不通,QQ也永远不在线了。 
仔细想来,使用PHP开发的程序,都是源代码,辛辛苦苦写出来,任何人都可以拿去随便用随便改,这确实是个头疼的问题.
1,那么要怎么加密自己的php代码?
2,让加密的php代码在别人的电脑上也可以运行.


回复讨论(解决方案)

自己搞一个空间, 要测试的时候, 放自己的空间上。

加密的还是可以破解的,可以自己弄个站把代码上传到上面,别人可以通过域名查看效果,等他付费了再把源码给他

加密的还是可以破解的,可以自己弄个站把代码上传到上面,别人可以通过域名查看效果,等他付费了再把源码给他



加密的还是可以破解的,可以自己弄个站把代码上传到上面,别人可以通过域名查看效果,等他付费了再把源码给他



加密的还是可以破解的,可以自己弄个站把代码上传到上面,别人可以通过域名查看效果,等他付费了再把源码给他



如果代码没加密,他不是可以通过页面另存为将代码,图片,脚本下载下来?

加密的还是可以破解的,可以自己弄个站把代码上传到上面,别人可以通过域名查看效果,等他付费了再把源码给他


另存为的代码也只是页面html的,php的又看不到,不然程序员不悲催了 


加密的还是可以破解的,可以自己弄个站把代码上传到上面,别人可以通过域名查看效果,等他付费了再把源码给他


另存为的代码也只是页面html的,php的又看不到,不然程序员不悲催了 

好吧,话说要怎么实现下面的功能?
1,那么要怎么加密自己的php代码?
2,让加密的php代码在别人的电脑上也可以运行.

对 php 代码加密有专业的加密软件(收费的),加密后的代码要在相应的解密环境中运行
对 php 代码预编译有 zend 的预编译工具(收费,但有盗版的),预编译代码同样需要有 zend 的虚拟处理机
对 php 代码做扰码处理,扰码可理解为自解密的加密,运行时没有特殊要求

无论你做什么处理,客户总是要拿到能运行的代码的。至于客户用此代码做了什么不该做的事情,只有寻求法律的保护了
尽管中国人很聪明,但由于缺乏法律意识,在科技领域总是落后与美国人、日本人.....

可以用md5来加密吗?加密后可以破解吗?

md5 不是加密,所以也无解密一说

再说,如果对方了你加密的技术,那不就可以解密出源码了吗?那么加密还有什么意义呢?

放自己空间测试,测试好了再给。或是走担保交易啊。

function encode_file_contents($filename) {
$type = strtolower ( substr ( strrchr ( $filename, '.' ), 1 ) );
if ('php' == $type && is_file ( $filename ) && is_writable ( $filename )) { // 如果是PHP文件 并且可写 则进行压缩编码
$contents = file_get_contents ( $filename ); // 判断文件是否已经被编码处理
$contents = php_strip_whitespace ( $filename );

// 去除PHP头部和尾部标识
$headerPos = strpos ( $contents, ' $footerPos = strrpos ( $contents, '?>' );
$contents = substr ( $contents, $headerPos + 5, $footerPos - $headerPos );
$encode = base64_encode ( gzdeflate ( $contents ) ); // 开始编码
$encode = '";

return file_put_contents ( $filename, $encode );
}
return false;
}

// 调用函数
$filename = 'test.php';
encode_file_contents ( $filename );
echo "OK,加密完成!"?> 

没有什么好方法,一般来说,只提供页面,付款后提供源码

function encode_file_contents($filename) {
$type = strtolower ( substr ( strrchr ( $filename, '.' ), 1 ) );
if ('php' == $type && is_file ( $filename ) && is_writable ( $filename )) { // 如果是PHP文件 并且可写 则进行压缩编码
$contents = file_get_contents ( $filename ); // 判断文件是否已经被编码处理
$contents = php_strip_whitespace ( $filename );

// 去除PHP头部和尾部标识
$headerPos = strpos ( $contents, ' $footerPos = strrpos ( $contents, '?>' );
$contents = substr ( $contents, $headerPos + 5, $footerPos - $headerPos );
$encode = base64_encode ( gzdeflate ( $contents ) ); // 开始编码
$encode = '";

return file_put_contents ( $filename, $encode );
}
return false;
}
// 调用函数
$filename = 'test.php';
encode_file_contents ( $filename );
echo "OK,加密完成!"?> 



原来页面内容变成 
eval(gzinflate(base64_decode('41JILUvM0UivysxLy0ksSdVISixONTOJT0lNzk9J1VB3LHe0VdfU1LRWsLcDAA==')));
运行效果不是原来页面的

这个要对于懂的,一般的加密都没有用的

我想要的效果是,别人看到你的源代码是乱码,但是能显示运行效果,至于容不容易破解先不考虑.

有很多PHP加密代码啊,不过都容易解~~~

破解这方面先不考虑,前面的实现了再说

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Performance Tuning for High Traffic WebsitesPHP Performance Tuning for High Traffic WebsitesMay 14, 2025 am 12:13 AM

ThesecrettokeepingaPHP-poweredwebsiterunningsmoothlyunderheavyloadinvolvesseveralkeystrategies:1)ImplementopcodecachingwithOPcachetoreducescriptexecutiontime,2)UsedatabasequerycachingwithRedistolessendatabaseload,3)LeverageCDNslikeCloudflareforservin

Dependency Injection in PHP: Code Examples for BeginnersDependency Injection in PHP: Code Examples for BeginnersMay 14, 2025 am 12:08 AM

You should care about DependencyInjection(DI) because it makes your code clearer and easier to maintain. 1) DI makes it more modular by decoupling classes, 2) improves the convenience of testing and code flexibility, 3) Use DI containers to manage complex dependencies, but pay attention to performance impact and circular dependencies, 4) The best practice is to rely on abstract interfaces to achieve loose coupling.

PHP Performance: is it possible to optimize the application?PHP Performance: is it possible to optimize the application?May 14, 2025 am 12:04 AM

Yes,optimizingaPHPapplicationispossibleandessential.1)ImplementcachingusingAPCutoreducedatabaseload.2)Optimizedatabaseswithindexing,efficientqueries,andconnectionpooling.3)Enhancecodewithbuilt-infunctions,avoidingglobalvariables,andusingopcodecaching

PHP Performance Optimization: The Ultimate GuidePHP Performance Optimization: The Ultimate GuideMay 14, 2025 am 12:02 AM

ThekeystrategiestosignificantlyboostPHPapplicationperformanceare:1)UseopcodecachinglikeOPcachetoreduceexecutiontime,2)Optimizedatabaseinteractionswithpreparedstatementsandproperindexing,3)ConfigurewebserverslikeNginxwithPHP-FPMforbetterperformance,4)

PHP Dependency Injection Container: A Quick StartPHP Dependency Injection Container: A Quick StartMay 13, 2025 am 12:11 AM

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Dependency Injection vs. Service Locator in PHPDependency Injection vs. Service Locator in PHPMay 13, 2025 am 12:10 AM

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHP performance optimization strategies.PHP performance optimization strategies.May 13, 2025 am 12:06 AM

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHP Email Validation: Ensuring Emails Are Sent CorrectlyPHP Email Validation: Ensuring Emails Are Sent CorrectlyMay 13, 2025 am 12:06 AM

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.