|
-
Aug 20th, 2007, 04:37 AM
#1
Thread Starter
Hyperactive Member
Encrypt && Decrypt PHP Script
Hi All,
I have a question. Is it possible to encrypt a php script ? I mean I do not want to show my php script to users. If somebody is trying to access it from View --> Source Code , then he would not be able to see it. If it is possible to encrypt the entire html, java script and php script then it will be so good. Again we need to decrypt it. Please help me out.
Thank you so much in advance.
-
Aug 20th, 2007, 08:04 AM
#2
Hyperactive Member
Re: Encrypt && Decrypt PHP Script
You need to seperate out the PHP and HTML/Javascript into different categories.
User won't be able to see your PHP code, only the people who have admin access to your web server will be able to see your PHP code. If you are the only user with access to you web server this is uneeded. I have seen some commercial PHP software using a PHP encoder of some type. However, it requires your user to install the encoder as well, which probably involves them paying for an additional license.
If you want to encode your script then read this site. It details several products that accomplishes it.
http://www.seocompany.ca/software/fr...-software.html
As trying to hide your HTML/Javascript. There is not really a good way. In the end your web browser will have to read it.
There is software out there you can google for that will "encrypt" your HTML. What it is really doing is using javascript and document.write to have an encrypted verision of your page. This will stop most people and web crawlers from reading your page with view source. However, most human can figure how to "unencyrpt it" your HTML code. You just run the algorithmn or reverse it depending on the situation.
As to javascript, it works in the same way. You can encrypt, or more accurately obfuscate the code, but with a little work, someone will be able to read it. Again this will stop web crawlers and the casual person viewing your source.
The moral of the story is, your web browser will have to see an unencrypted verision of your page before it is displayed. So, at some point the page will have to unecyrpt it self and reveal it's source.
What I am getting at is, don't bother. The only expection to that is I would watermark mark your images.
Last edited by superbovine; Aug 20th, 2007 at 08:08 AM.
-
Aug 20th, 2007, 08:33 AM
#3
-
Dec 12th, 2007, 05:24 AM
#4
Thread Starter
Hyperactive Member
Re: Encrypt && Decrypt PHP Script
Thanks superbovine. Your given site is helping.
And yes mfurqan, you understand my problem correctly. I like to give my php source code to someone who can use it only, but unable to see or modify my code. Except third party tool, is there any better option.
Is it possible to use PHP to encrypt PHP code ? Can we use any encryption technology ? Say MD5.
Please try to provide some sort help. Thanks.
-
Dec 12th, 2007, 07:35 AM
#5
Re: Encrypt && Decrypt PHP Script
 Originally Posted by systech44
Thanks superbovine. Your given site is helping.
And yes mfurqan, you understand my problem correctly. I like to give my php source code to someone who can use it only, but unable to see or modify my code. Except third party tool, is there any better option.
Is it possible to use PHP to encrypt PHP code ? Can we use any encryption technology ? Say MD5.
Please try to provide some sort help. Thanks.
You can MD5 encrypt you PHP script. It is a very secure encryption because it is impossible to decrypt :P. I.e: MD5 is a one way hash function.
The best you can do with a PHP script is obfuscate it and transform it or encrypt it usiong mcrypt. However, there will always have to be code inside your script to turn it back in to a legible script. The Zend encoder works by transforming the PHP code to byte code and by obfuscating the logic through optimizations.
Obfuscation is your best weapon here. You can encrypt variable names and you can remove 90% of the white space from your code. This will make it harder for an adversary but not impossible.
In 90% of cases there is no need to protect your source code however. The someone knows how an application works it can often be reverse engineered. If you have an original idea you need to apply for a world wide patent and get it copyrighted appropriatly.
-
Dec 13th, 2007, 12:08 AM
#6
Thread Starter
Hyperactive Member
Re: Encrypt && Decrypt PHP Script
Thanks a lot VisualAd for the reply. Can you please provide me some documentation, url or anything that can make me understandable in MD5 and its implementation.
By the way, what if there will be different server available. Is the php code run properly ?
Thanks a lot.
-
Dec 13th, 2007, 03:54 AM
#7
Re: Encrypt && Decrypt PHP Script
 Originally Posted by systech44
Can you please provide me some documentation, url or anything that can make me understandable in MD5 and its implementation.
He was joking. Hash functions are one way only.
Consider whether you need to encrypt your software at all. vBulletin, the software that this forum runs on, is a commercial closed-source product which is distributed unencrypted. The large community of vBulletin modification authors would not exist if its source code were encrypted. The relatively small amount of genuine piracy that does occur is a fair trade-off for the benefits of enabling an enthusiast community to exist.
If you must encrypt your code, Zend Guard is probably the best solution, but it's really not cheap.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|