/    Sign up×
Community /Pin to ProfileBookmark

How To Protect PHP Code From Plagiarism ?

PHP Experts,

Say you wrote a good PHP script. And you sold licenses to it. Now how you gonna prevent piracy ? Your buyers can easily copy the code over and over again and sell each time. This riping you off.

How can you encrypt your PHP source code so they can’t modify the code ? Say you gave away an ad version. You don’t want your users removing your ads now do you . Hence, you need to encrypt the whole code so they can’t identify that part of the code that displays the ad to remove it.
So, how to encrypt your PHP source code ?
How to make it difficult for them to identify the
part of the source code that displays your ads ?
I mean, they can delete one encrypted line by line and run the script each time to check if your ad is removed or not. They can do this one line by line (combing operation) from top to bottom and test on each line deletion whether your ad is still active or not. When they delete a line and see your ads or your sponsor’s ads no longer appearing then they will guess they deleted the appropriate line that triggers your ads.
How to prevent them from identifying the relevant ad code line ? Got to foil their crookery!
Or say, your PHP script reports usages to your database, you don’t want them identifying the line that mentions your server, dB, etc and deleting it, even if the lines are encrypted, now do you ? I mean, if they manage to delete the right line then you will no longer get the usage data sent to your server. Or worst, they may replace it with their own server details and sell copies of it under your name. Their customers will think their usage data is getting collected by your servers when in reality they are getting collected by your rip off! Then your rip off can go and sell your user’s usage stats and land you in trouble with the law for selling user stats without their permission. Dangerous!

Is there away, I can get the code lines to scramble themselves if their PHP file is opened in a text editor or get the lines modified (into phoney code lines) or get all or some part of the codes deleted ? That way, the actual main source code will be protected.
I, as the programmer, should have a choice whether to have the original code get intact again once the file is closed in the PHP editor or permanently have the said code lines modified or deleted. If they get permanently modified/deleted then the PHP script will no longer work. Serves the buyer (rip off) for trying to sneak peek in the protected code. Otherwise, the PHP code/program/script will start functioning again once the php file is closed again on the PHP Editor. It will only start malfunctioning whilst open in the PHP editor.
Actually, this should happen no matter what file reader or editor they use. Be it PHP editors or otherwise like NotePad, Word Pad, MS Office, etc.

Interesting topic, hey ?

Anything else I need to know ?

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@sibertMar 03.2021 — > @developer_web#1628826 So, how to encrypt your PHP source code ?

One way to protect PHP code is to use "microservices" for critical parts. Code not reachable the normal way. I guess you can create microservices in PHP, Node.js, C++, Golang or whatever. The best way is to use a compiled language that not could be read by humans without huge amount of knowledge.
Copy linkTweet thisAlerts:
@developer_webauthorMar 03.2021 — Folks,

Don't reply back that I can always create client terminal php scripts where they will connect to my main terminal (server PHP) and receive PHP commands or function commands from my end how to function on their ends. That way, even if they open the source code and snoop, they won't find the function codes of the features but only code Ines that connect to my server to receive the function commands.

I can easily do this, even though I am still a PHP or programming beginner. Problem is, if millions of client terminals connect to my main terminal or server then my server will be clogged and all the client terminals will receive commands in delay. This their websites will slow down. Also, my server side will be a target by hackers etc. If it attracts virus or dos attacks then this will reflect on the client terminals (like your website). Virus could spread from my server side to your client terminal side.

No. I don't want to run this venture in a client server hierchachy. Best peer to peer.

Best I encrypt the source code where the whole program's source codes are on the clientside. This way, my bandwidth gets saved too.

Oh you know what I am taking about!
Copy linkTweet thisAlerts:
@developer_webauthorMar 03.2021 — @sibert#1628829

And just how am I gonna compile a website ?

I can understand if I was building a desktop software (.exe) as those need compiling.

But I am building a website with PHP and PHP code needs to be interpreted by the PHP interpreter on the fly.

Frankly, I don't have experience with any other languages apart from html, CSS and PHP.

Doesn't PHP have a mechanism to protect source code ? If not, then how do these big pHP vendors protect their source codes from their buyers ?

What do you mean by micro service ? Show me example. Elaborate more.

Cheers!
Copy linkTweet thisAlerts:
@developer_webauthorMar 03.2021 — Folks,

Does not PHP have asource code encryptor/decryptor function or engine on the PHP interpreter so if our PHP files are encrypted, it decrypts the code before interpreting the code on the fly ? How come the PHP vendor foolishly, and I say, GREATLY foolishly missed this feature ? We now have to make a suggestion and pray they'd add it to version 9 ? Silly fools!
Copy linkTweet thisAlerts:
@sibertMar 03.2021 — > @developer_web#1628831 What do you mean by micro service ? Show me example. Elaborate more.

Think of microservices as a hidden buddy you communicate with. This buddy is simply another server that cannot be reach by other than the localhost. You can communicate with this server with REST or similar. You simply split your code from reachable parts and hidden parts.

I think that you cannot protect an interpreted language without using microservices. The soul of an interpreted language is that it should be readable by human.

I am in the process of creating an API. This is an attempt to explain how it works. API is a microservice sort of. http://94.237.92.101:6060/home
Copy linkTweet thisAlerts:
@developer_webauthorMar 06.2021 — @sibert#1628833

Your link lead me to nowhere.
×

Success!

Help @developer_web spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...