On Encrypted Script

Does encryption have any effect on script- make it slower/faster, can something go wrong with the script later…

Using encryption how? Doing what?
More information is required.

Just to obfuscate or “protect” the script.

And what are you “protect”-ing it from? But yes it will hamper performance greatly.

From code ‘stealers’.

Oh? So you have super unique and top secret code that the NSA themselves developed? Something the is super important and requires the most expensive obfuscation process money can buy? [/sarcasm] …Unless you have something worth protecting, don’t bother. Wanting to hide your unimportant-general-every-noobie-can-make code is amateur at best. You would end up just wasting CPU cycles just to run 3 lines of mundane code.

How did you know that ?:frowning:

Got any fact to show that encryption reduces performance?

How did you know that ?
Because, you are here asking about it.

You mean you do not understand how encryption works? Its not a secret that encryption is a computation1 burden on any processor. Before you could execute a PHP script that is encrypted it must first be decrypted, depending on the encryption method, load on the server, etc., this can take various amount of time. All in all it WILL reduce performance, no question about it.

[SIZE=1]1 computation - The action of mathematical calculation

[/SIZE]Just so it is clear. You should only ever use encryption on super-important things that need to remain private, like Credit Card numbers. Otherwise you are adding unnecessary burdens.

No need to get snarky here…

From what I’ve seen on small to medium sized scripts, the performance hit is negligible.

If you’re only running a script on your own server, then encryption probably isn’t necessary. If it’s something you’re going to distribute and something that you don’t want to give folks access to the source code, then that’s where code encryption is appropriate to use.
IonCube’s online encoder is an inexpensive route to take if you don’t plan on encoding much and don’t want to shell out ~$200 for Zend’s or IonCube’s fully-fledged encoder application.

Thats just the way I am. I’ve been around long enough to know that trying to protecting your code like this is worthless. You waste money and CPU cycles. Save the encryption for things that actually matter and need to be protected. Trying to protect code that everyone can write is a waste of time.

From what I’ve seen on small to medium sized scripts, the performance hit is negligible.
And unnecessary. Wasting CPU cycles just to decrypt general-unimportant code is a waste of resources. And it is never “negligible” when you don’t factor in all the variables. What do you think would happen if your site went viral? And you start getting hundreds upon thousands of hits? Or you are running on a limited, shared server? Along with many other configurations to take into account. It is not negligible.

tentim, is your script just going to be running on your own server, or is it something you will be distributing?

Well, it will be running on my own server, i.e. a commercial shared server

Then it’s probably not necessary.

Of course, that’s no rocket science(even if it were, i’ll be quite at home).

I thought I got the idea from somewhere on the web(can’t remember exactly)
that obfuscated code is sort of semi-interpreted, so the php parser picks
up from there, that’s why i asked in the original question, if obfuscated code
could be faster…

Obfuscated code just makes the code harder to read for us humans. It doesn’t do much for the speed of execution. It just jumbles up some of the variable and function names.

Encrypted code transforms the code using an algorithm to make it unreadable to anyone or anything without the proper key. This means the code is encrypted both going in and coming out, so that adds processing time.