MidnightLightning
MidnightLightning

Reputation: 6928

Encryption with PHP Phar

Is it possible to encrypt/password-protect a Phar archive to enable closed-source software distribution?

Upvotes: 7

Views: 4512

Answers (2)

cweiske
cweiske

Reputation: 31107

Wanting to have a company purchase closed-source software,

In that case, phar alone will not help you. Look for a bytecode compiler like ioncube.

Upvotes: 4

mario
mario

Reputation: 145482

Phar supports zip, and zip files can be password-protected. But you would need a monkey for typing in the zip password whenever a request comes in. So no, not useful for closed-source software.

But to make this a somewhat serious answer, no it really doesn't work:

PHP Warning: include(phar://phar.zip): failed to open stream: phar error: Cannot process encrypted zip files in zip-based phar "phar.zip" in php shell code on line 1

Upvotes: 5

Related Questions