1

i have done with my coding and all is set,

i want my all code in that folder in encrypted format,

and anybody move that file to another server then also that file will not work,

i want solution for that i tried some links but there only one page going to encryp but i want to encrypt my folder that contain site details of admin,

Some of links are not getting proper answers and i want that after successfully encryption of code my site will not damaged, and if i want to decrypt it then i can.

Is there any way to do that.???

Thank you in advance to all of you.

Gumbo
  • 643,351
  • 109
  • 780
  • 844
parth
  • 29
  • 7

2 Answers2

1

Completely encrypting your code is possible, for instance with Ioncube. This however requires a special ioncube loader on the server where your application runs. Ioncube is one of the most used code encryption tools around.

A problem however with all types of code encryption is that it's always possible to decrypt. Anything interpreted by a machine can be traced and decrypted. However it might take a very long time to do so and as @Mike points out in his comment below, decrypters (might) only work for the version they've been built for.

For info about ioncube decryption: ioncube decryption in seconds

Community
  • 1
  • 1
Luceos
  • 6,629
  • 1
  • 35
  • 65
  • One important note is missing: it's easily "decrypted" – zerkms May 06 '14 at 05:12
  • @zerkms I was updating my answer with exactly the same information ;) – Luceos May 06 '14 at 05:13
  • @luceos "it's not that hard to decrypt". More accurately, it's not hard to use a tool from *someone else* to decrypt, but producing such tools *is* hard and has taken hackers years with still mixed success. Sites targeting encoded files from all vendors do exist though, and is an industry wide problem. Encoding tools do tend to get updated, with files from older tools understandably being more vulnerable. Using current tools and optimal settings *is* effective, but the landscape is ever changing and providers do need to innovate and update as necessary. Disclosure: I am associated with ionCube – Nick May 08 '14 at 22:13
  • @Nick; Having not mentioned the ability to decode would have made the answer less accurate. You are correct with your statement, as a customer of yours, I can only stress it. But the point is, whatever is interpreted by a machine can be decrypted, no matter the time or effort requirement. – Luceos May 09 '14 at 06:48
  • @Luceos Absolutely, and it's similar when it comes to analysing hardware. Sensors such as light, heat and voltage can be found on some chips to defend against attack when the silicon is exposed, yet bypassing those barriers still happens. AFAIK, all existing encoding tools have a certain inherent weakness, which is understandable given how the tools need to work, but one that really needs to be looked at. We've come up with a novel approach to address this and are working on it currently. We're mindful that not all will understand how to take advantage of the technique, but we hope many will. – Nick May 09 '14 at 11:09
0

I would suggest you zip your entire folder (that consists of your code and stuff) and assign a password to it.

You can use ZipArchive::addGlob() to zip all your files on your folder..

<?php
$zip = new ZipArchive();
$ret = $zip->open('files.zip', ZipArchive::OVERWRITE);
$options = array('add_path' => 'yourfolder/', 'remove_all_path' => TRUE);
$zip->addGlob('*.{php}', GLOB_BRACE, $options); //<--- Adds only your PHP files to the archive..
$zip->close();

Well, that was the first step , to set a password you need ZipArchive::setPassword() which is still under PHP 5.6 Beta features and you may give it a shot. (May help future visitors)

Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
  • Unfortunately this would not help from stopping code running on a different server as the OP wanted. The user of the code would need the password to access the code, and so they could run the same code on different servers. If the password is used in a script it would also be plainly visible to anyone else with access to the same scripts. – Nick May 08 '14 at 21:54