Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
There are many code protection libraries in php, however they require installation of additional php modules, which I can not afford because the application will be running on servers I do not own. So I thought I could make my own.
What I want to do:
$source = file_get_contents("encryptedPhpFile.php");
$source = decrypt($source, "mySecretKey");
//$source now contains decrypted source code which needs to be included
//I cant use eval($source); because that code also contains
//html/css/opening and closing php tags ... which eval() does
//not know how to render
//I cant write the source into temporary file and then include
//that file because as soon as I write decrypted source to a disk,
//it is exposed and it can be copyed
What can I do? Any suggestions?
These libraries are modules for a reason. You will not be able to fully simulate them in "code space". Your attempts will be clumsy (not your fault) and make your codebase far less pleasing/maintainable.
You should instead focus your efforts on obtaining permission to install them, migrating to a host that lets you control your server to a useful degree, or getting your own server up and running.
Again and again.
We cannot protect PHP source code. PHP was not meant to be 'protected'. Even compiling code to binary is prone to reverse engineering. In your example, when you decrypt source with secret key (how secret - there he is) you do what? Eval it? Replace eval with echo.
Write license & do legal job with lawyer. Organize business model so your customers would want to pay you so they could get updates & support.
Regarding code protection libraries (paid ones): there are free online services that automatically decode them for you...
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am hoping to build a program to securely pull data from a variety of external servers and then put this information into a standardized database (probably MySQL). I know this is a very general description of a program, but I'm trying to build it in a few different cases.
Example) My school uses two different web services (and sometimes professors built their own sites) to list homework for students. I would like my program to log into each site and pull the assignment, due date, etc and put it into one database so that all homework can be displayed on one page, added to a calendar, etc.
First question) How do I do this in a secure way. Some of the sites require me to log on with a pretty vital username/password pair. Some cites even require a different username/password pairs. How would I log on to the site without listing my password somewhere in the source code (obviously this would be a bad design choice). The sites do not provide an API to do this. Say I need to draw from sites using 20-30 username/password combos. Would the best way to do this then be to have a list of all my username password combos encrypted with a general password?
scrapy, already mentioned in a comment, is a good first hint for further investigation into scraping with python. Personally, I prefer programming directly with pycurl and BeautifulSoup, but this is a matter of taste.
Regarding authorization, you should investigate whether the web sites you are about to scrape support Basic authentication. If so, you can easily pass user/password in a header (which is simple in pycurl which is why I love it). If Form based logins are required, the authentification will call for a bit more coding. Pray that no one insists on certificates... In any case, you should carefully make sure to use https and not http to avoid sending your password freely readable through the internet.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Here's what I need: I have a table in a SQLite file, that contains items - descriptions, dimensions, image and thumbnail.
I need to allow someone from outside the company to edit this table through an "admin interface". I need a simple login mechanism to authenticate said user, and I need a form that shows all available rows in the table applicable to him/her, and allow editing the values. That may include uploading images.
Now, I've developed tons of these interfaces before, in several languages. What I'd like to ask is: is there a shortcut? Since this needs to be quick and dirty (i.e., this wasn't in the original plan, I'm not being paid for this, but I may lose a client if I don't have it in place) and be up as soon as possible, is there some open source solution, or any previous PHP code, that I can customize and use in this and future cases?
Any solution that will save me time is welcome.
Thanks for YOUR time :)
Guy
Well if you can use a framework you could use an auto generated admin interface or scaffolding from a framework. Symfony and Cake both have this. Of course thats a lot of dead weight to have if the whole app/site isnt using the framework. But it would make it relatively painless to create. IF you can run this interface on a subdomain that would make it even esier since you dont have to worry about integrating it with anything existing except the DB and shared folder for the uploaded files.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Is there any PHP refactoring tool that would transform a huge noodle code to a proper function based one?
No, you can't do that automatized. Static analysis may reformat your code, eliminate bad practices or inform you about security vulnerabilities, but it can't turn your code into nice and clean OOP.
2019+ answer
Nowadays you can use a tool called Rector (I'm author of).
It uses nikic/php-parser, static analysis and node based rules. That means you can e.g. rename every case of function strlen to Nette\Utils\Strings::length().
Or basically anything you want to. Many rules are supported from in the core code (see Rector on Github), e.g. upgrade from PHP 5.2 throughout to 7.4.
But it can be configured to do what you want. It will take some thinking to determine how to detect what should be extracted and what not. If you can put the transformation into words as a human, it's possible to put that into PHP code so it will do everywhere in your code for you.
Zend Studio (for Eclipse) has support for refactoring code - it allows you to select a piece of code and extract functions/methods. For example:
It also allows for renaming of variables to further clean up your code. While this is not a fully automated solution, it will significantly help you clean up the mess. Hope this helps.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm in the process of generating API docs for an in-house web app that's undergoing some expansion. It's a DHTML project, with a mix of both some OO and mostly procedural PHP, and purely procedural Javascript. At the moment, it's pretty much all documented for the appropriate doc generators (phpdocumentor and jsdoc), but the two were never "connected". I could go through and add manual link statements to the doc blocks, but managing all those links (like "../jsdoc/filename.html#function) is a real pain.
Any suggestions for documentation generators that handle both PHP and JavaScript, and allow something like #see functionName between languages?
If worst comes to worst, I can hack together a script to rewrite LINK URLs from some magic syntax (i.e. js: and php:), but I'd really rather have something that will allow a unified tree view of everything.
Thanks,
Jason
After looking at a number of options, I wrote a PHP script that parses JS files, pulls out the doc blocks and function definitions, and then writes it to a file that phpdoc can process. It just needs one line added to phpDocumentor.ini so it will parse .js files.
The blog post talking about it is at:
http://blog.jasonantman.com/2010/08/documentation-generation-for-web-apps-php-and-javascript/
And the script is at:
http://svn.jasonantman.com/misc-scripts/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a barcode scanner and laptop (ofcourse :)), I'm looking for simple event management app that can process the input from the barcode scanner and keep attendance record for our frequent private meetings.
I wonder if there's an open source software available that'd allow me to manage events using code 128 barcode id cards?
Many thanks for your help.
DIY. Seriously, this would be a perfect project to do. If you're inclined that way!
If you have a barcode scanner that follows some standards in interfacing (serial etc.) and protocol then PHP will be able to read the data. After that it's plain sailing!
EDIT: Seems like amazon sells barcode readers that act like keyboards. This makes interfacing the least of your problems!
Choose a scanner that acts as a keyboard and automatically translates the code 128 to a series of numbers followed by a "return". That way you could use any ol' spreadsheet, website or even Notepad to keep track of your meetings.
Look at Drupal and the many plug-ins that are available there. There are complete conference kits that you should be able to use. I think going for that kind of monster solution will just complicate matters - the relative simple task involved taken in to account...