Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypt and embed static resources (js/css/images) inside phpdesktop executable #18

Open
GoogleCodeExporter opened this issue Aug 28, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

We need a way to protect the www/ directory, using php encoder
is an option, but it won't protect other files in the www
directory.

Before we start work on thiss issue we need to implement Chrome 
engine (Issue 1) and PHP API calls (Issue 3).

If the www directory is embedded in zip file, we should not extract
it anywhere to the file system, the best way is to extract it to
memory, so that it's really hidden. But doing it this way won't
work with web-server (unless we modify web-server to work with our
virtual in-memory filesystem). In Chrome web-server is not needed,
as there Scheme handler that acts similarly to a web-server.

For keeping www directory in memory we will probably need some kind
of Virtual File System.

To execute PHP scripts that aren't accessible through local file
system we would have to hook up to the PHP API (Issue 3).

The www directory can be encrypted in a zip file using AES encryption,
we could use this simple C++ library:
http://www.lomont.org/Software/Misc/AES/AES.php

We will also need some zip library.

An option for the zip file to reside along with the exe file (
data.zip or data.dat - the zip filename could be customized through
settings.json file).

The best option would be to embed that zip file in exe file as
a resource.

Some tool for automating the process of encrypting zip file and
embedding it in exe file would be useful.

Original issue reported on code.google.com by [email protected] on 2 Feb 2013 at 3:13

@GoogleCodeExporter
Copy link
Author

When this issue gets implemented, think about embedding settings.json file in 
the
exe file as a resource, to protect it from prying eyes.

Original comment by [email protected] on 2 Feb 2013 at 3:26

@GoogleCodeExporter
Copy link
Author

Chrome engine is not necessary for this issue to get implemented.

Original comment by [email protected] on 2 Feb 2013 at 3:56

@GoogleCodeExporter
Copy link
Author

To use an in-memory file system in Mongoose web-server you have to
implement "open_file" callback, example here:

https://github.com/valenok/mongoose/blob/ee55d38b5592cbb55b78c74c2c36fc768fc22a0
7/test/unit_test.c#L192

Original comment by [email protected] on 2 Feb 2013 at 5:28

@GoogleCodeExporter
Copy link
Author

Serving static resources from the in-memory file system using Mongoose
web-server seems easy, but things get complicated for the PHP scripts
executed through PHP API, you would have to implement more callbacks 
in the Mongoose for handling request variables, submitting forms and 
uploads.

Original comment by [email protected] on 2 Feb 2013 at 5:42

@GoogleCodeExporter
Copy link
Author

See this topic for an in-memory filesystem with Mongoose:
https://groups.google.com/d/topic/mongoose-users/JhNQFKC_0wI/discussion

Original comment by [email protected] on 2 Feb 2013 at 5:57

@GoogleCodeExporter
Copy link
Author

See also Issue 90 "Compile javascript to native code".

Original comment by [email protected] on 16 Feb 2014 at 4:25

@GoogleCodeExporter
Copy link
Author

There is this simple batch command that can embed resources in an exe file:

  copy /b phpdesktop.exe+resources.zip phpdesktop.exe

(found in node-webkit examples, haven't tested it yet).

Original comment by [email protected] on 16 Feb 2014 at 4:30

@GoogleCodeExporter
Copy link
Author

Encrypt the ZIP file with 7-zip before embedding it in an exe. Use for example 
AES-256 encryption. For command line examples see:

  http://www.cnx-software.com/2011/02/22/aes-256-encryption-and-file-names-encryption-with-7-zip-7z/

Original comment by [email protected] on 16 Feb 2014 at 4:35

Repository owner deleted a comment from GoogleCodeExporter Jun 11, 2017
Repository owner deleted a comment from GoogleCodeExporter Jun 11, 2017
Repository owner deleted a comment from GoogleCodeExporter Jun 11, 2017
Repository owner deleted a comment from GoogleCodeExporter Jun 11, 2017
Repository owner deleted a comment from GoogleCodeExporter Jun 11, 2017
Repository owner deleted a comment from GoogleCodeExporter Jun 11, 2017
Repository owner deleted a comment from GoogleCodeExporter Jun 11, 2017
Repository owner deleted a comment from GoogleCodeExporter Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@cztomczak @GoogleCodeExporter and others