I fully support this effort and while it is true that any released binary file can be exploited, the last comment completely misses the point. By using something like bytecode, you are making it harder for someone to see your code, and thus, are making a good faith effort to protect your IP. In a perfect world, people would not try to steal your IP or your physical property. Since people will steal your stuff, following the same logic above, the author would have us EITHER leave our keys in our car, keep our house doors unlocked, and walk down dark alleys at night OR living in a cave that we never leave.
I have many years of security experience. The common rule of thumb in encryption is to encode something past the point that normally makes it worth decrypting. NSA can break into your SSL traffic any time they want, but why bother. There is normally nothing there worth anything (to them) and they have other uses for their CPU cycles. The thing that protect the data in your SSL transaction is not the rather low-level method of encryption being used, but the sheer volume of SSL traffic that makes it doubtful anyone will even bother to decrypt it.
Some companies, like mine, need to pay their employees so we need to do the best job we can at not releasing the results of our NRE. I plan to use something like bytecode to protect our new product to reduce (not eliminate) the chance the code will be used illegally. People who are smart enough to reverse engineer bytecode, should be smart enough to read a licensing agreement and understand that a company has legal recourse for breaking it.
Introdução
Este módulo é EXPERIMENTAL. O comportamento desta extensão — incluindo o nome de suas funções e qualquer outra documentação sobre esta extensão — poderá mudar sem aviso em futuras versões do PHP. Esta extensão deve ser usada por sua própria conta e risco.
Bcompiler foi escrito por várias razões:
- Para codificar script em uma aplicação PHP proprietária
- Para codificar algumas classes e/ou funções em uma aplicação PHP proprietária
- Para disponibilizar a produção de aplicações php-gtk que poderiam ser usadas em clientes desktops, sem precisa do php.exe.
- Para estudar a possibilidade de fazer um conversor de PHP para C
O segundo desses objetivos é alcançado usando as funções bcompiler_write_header(), bcompiler_write_class(), bcompiler_write_footer(), bcompiler_read(), e bcompiler_load(). Os arquivos bytecode podem ser escritos ou como não-compactados ou planos. O bcompiler_load() lê um arquivo compactador bzip que contém bytecodes, o que tende a ser 1/3 do tamanho original do arquivo.
Para criar arquivos do tipo EXE, bcompiler tem que ser usado com um arquivo de SAPI modificado ou uma versão do PHP que tenha sido compilada como uma biblioteca compartilhada. Nesse cenário, bcompiler ler o bytecode compactador do fim do arquivo executável.
bcompiler pode aumentar performance em volta de 30% quando usado com bytecodes não-compactados apenas. Mas lembre-se que bytecode não-compactado pode ser até 5 vezes maior que o código-fonte original. Usar compactação de bytecode pode evitar gasto de espaço, mas descompactar requer muito mais tempo do que avaliar um fonte. bcompiler também não faz nenhuma otimização de bytecode, isso pode ser acrescentado no futuro...
Em termos de proteção de código, é seguro dizer que é seria impossível recriar o código-fonte exato do qual ele foi criado, e sem os comentários acompanhando o código-font. Seria efetivamente inútil usar o bcompiler para recriar ou modificar uma classe. No entanto, é possível recuperar dados de um arquivo bytecode compactado - então não ponha suas senhas pessoais ou coisa do tipo nele.
Introdução
20-Nov-2011 07:50
16-Apr-2008 06:55
The paragraph on code protection is somewhat misleading. While it is correct that the exact source code can not be recreated this does not offer anything in terms of code protection and lures people into a false sense of security. The same was thought of machine code until backward-engineering became so advanced that programs were "rewritten" to change the behaviour of functions or enable/disable them and the same is true for classes.
Overconfidence and "impossibilities" are what people looking for a challenge thrive on. Encryption and obfuscation are ways to make it more difficult but not impossible. As a general rule if it can be executed it can be modified so if you don't want it to be put under the microscope then don't release it in the first place.

bcompiler