1. Graphic User Interface

x. PhPCryptor Interface

phpcryptor main interface

PhPCryptor – Main Interface

Using the Interface

PhPCryptor includes menus ( A ), toolbar ( B ), project explorer ( C ), processing output windows ( H ) and also includes four tabs in the right pane to handle the project parameters and process control, Encoder Parameters ( D ), License Parameters ( E ), Project Output files header's & Decoder Errors Manager ( F ), Run encodig process ( G ).

a. Menu Options

PhPCryptor includes the following menu options:
File :   New Project, Open Project, Save, Save As, Close Project, Archive (Import, Extract) and Exit.
View :   Toolbar, Status Bar, Explorer, Dialog Tabs
Project :   Add item, Remove item, DO NOT Encode item, Encode Item, Default status, Compile Project, Open compiled items
Windows :   Window Cascade, Tile Horizontally, Tile Vertically, Arrange Windows
Help :   Help Topics, Search for help, About

b. PhPCryptor Toolbar

open new project 
New project
When you open phpcryptor, by default the parameters are set for a new project. Otherwise, the function 'New' will launch the sequences to close an existing project and setup the parameters for a new one.
open project
Open existing project
Displays the Open dialog box, where you open a project (*.bcp). After selecting an existing project, the Archive Dialog (Import Dialog) will popup to specify archive parameters (Archive password, location to extract the contents and the data category you like to import).
save project
Save project
The Save will play the role of 'Save As' when the function called for the first time for unsaved a new project. 'Save As' a dialog box will popup to specify archive parameters. 'Save' will simply save the project items with already specified parameters for the 'Save As'.
   
remove status 
Remove Status
Set the selected item(s) from phpcryptor explorer to remove status. The item(s) will be ignored (NOT processed, NOT copied and NOT saved).
donot compile status 
Exclude Status
Set the selected item(s) from phpcryptor explorer to Exclude status (DO NOT Compile). The item(s) will be copied as is to compiled directory.
compile status
Compile Status
Set the selected item(s) from phpcryptor explorer to Compile status (Compile). The compiling process will be applied to the selected item(s).
default status 
Default Status
Set the Selected item(s) from phpcryptor explorer to default status. Let PhPCryptor decide the item status, following the parameters set in the Encode dialog box.
   
add item 
Add item (file or directory) to project
Allow to add file or directory to existing project.
compile project
Compile project
Compile the project
open compiled project directory 
Open compiled directory
Allow to open the compiled project directory.

c. Project Explorer

phpcryptor project explorer

Useful window to customize the properties of project elements.

To change item Status Select an item from the tree and then click one of item status from menu; Remove, Exclude, Compile or Default.
To edit or display item properties Select an item from the tree and right click the mouse button, to display popup menu -> select appropriate item to apply.

d. Encoder Parameters

phpcryptor encoder parameters
D1 -
Add items to project.
D2 -
Select output project directory; by default the user directory 'documents' is specified.
D3 -
Specify the targeted PHP. The Compiled results must comply the PHP version specified.
D4 -
Specify desired PHP tags, short, long or asp tags for the compiled results. PHP4 (short, long and ASP), PHP5 (short and long) and PHP7 only long tags are used.
D5 -
Add or remove PHP files extension to be prcocessed. All files with extension listed in this section will considered as PHP file are automatically compiled.
D6 -
Add or remove files extension to be ignored by the encoder. All files with extension listed in this section, will not be processed and not copied to output directory.
General options -
PS: cleaning and optimizing php source are deactivated in this version.

e. License Parameters

license parameters
E1 -
Project ID. A new ID is generated each time you start a new project. A custom ID is generated by clicking Generate ID button.
E2 -
License key. The key will be used to crypt and decrypt all PHP sources. License Key is the only parameter required otherwise error message will be displayed during the compilation process.
E3 -
Specific option; (deactivated in this version).
E4 -
License type (external or embeded).
E5 -
Expiracy time. The encoded sources will expire on the specified date.
E6 -
The encoded sources, will be bind to specified IP (v4) address.
E7 -
The encoded sources, will be bind to specified domaines name.

f. Decoder Parameters

decoder parameters
F1 - Encoded files message header.
F2 - Decoder errors messages.

ENCODED HEADER MESSAGES LIST:

MESSAGE ID DEFAULT MESSAGE
MSG_HEAD : The Current File is encoded with PhPCryptor (PhP File Source Guard) from BorjTek (Borj Software Inc)
BORJTEK HEIGLY RECOMMAND THAT: DO NOT EDIT OR ALTER ANY ENCRYPTED FILES OTHERWISE THE REVERSE PROCESS WILL FAIL
MSG_CONTACT: Please, Contact Web Administrator admin@yourweb.com

DECODER ERROR MESSAGES LIST:

MESSAGE ID DEFAULT MESSAGE
ERROR_ALL: Undefined Error, Please Contact Web Administrator
ERROR_LICENCE_INVALID: The Licence Certificate is Not Authorized to Run on the Current Machine
ERROR_LICENCE_CORRUPTED: Licence Certificate is Corrupted
ERROR_LICENCE_EXPIRED: Licence Certificate is Expired
ERROR_LICENCE_PATH: Licence Certificate are Missing
ERROR_DECRYPT_INVALID: PhPCryptor Decrypt Function Not Loaded Properly

g. Processing Controls

compile controls
Compilation Process dialog - PhPCryptor allow the user to take full control during the compilation; especialy the big projects, at any time the user can suspend the compiling process, set the process priority and resume the compilation process. Abort button allow to cancel the current job.
2. Create a New Project

x. PhPCryptor Project

During this chapter, using a real project as an exercise you'll learn step by step, how to create a project, add the items, setting the output directory, setting encoding parameters, setting licensing parameters, customize the decoding error messages, compile the project and finally explore the results.
To setup and compile project with PhPCryptor, only two steps are required, (1) specify the input sources and (2) setup the Project Key from License Parameters dialog. All the other parameters are optional; The default parameters setting fulfill the need for the most projects.
  • a. Creating a new project.
  • b. Add items to the project.
  • c. Setting the output directory.
  • d. Setting the Encoding parameters.
  • e. Setting the Licensing parameters.
  • f. Customizing the Decoding errors.
  • g. Save the project.
  • h. Compile the project.

Simulation project :

The project developed for PHP5; Files extension are *.php and *.inc for include files.
Input source :    e:\projects_web\orion_web_prj
Output results :    e:\projects_web\output

a. Creating a New Project

To create a new project file :

from application menu :
File > New Project
from toolbar : click New Project item button add item

Starting PhPCryptor will automaticly start a new project and configure the parameters to default state.

b. Add Items to the Project

Step 1: Click Add items topic from menu or toolbar or Encoder dialog box to display folder browser.
from application menu :
Project > Add item
from toolbar : click Add item button add item
from Encoder Parameters Tab : add item
Step 2 - Define items path : from folder browser select the target directory and then click OK to display the application folder scanner dialog box.
add item
  • Navigate to the project location.
  • Select the project directory.
  • Click OK to confirm the project path.
Step 3 - Scan the selected path
add item add item
After closing the folder scanner, the application explorer and the input path are updated. To avoid any name colision with differents input sources, each input source (SRC) is wrapped within unic (SRC ID).
add info

c. Setting the Output Directory

Optional setting. PhPcryptor set the default output path to 'user\documents\phpcryptor'. To set a custom output path following steps below.
Step 1: Click Output Directory Topic to display Folder Browser from Application menu or from Encoder dialog box
from application menu : Project > Set Output Directory
from Encoder Parameters Tab : add item
Step 2 - Define items path : windows folder browser
add item
  • Navigate to the desired output location.
  • Select the output directory.
  • Click OK to confirm the output path.

d. Setting the Encoder Parameters

output directory
The default setting fits the project needs. Set PHP version to PHP5; Set PHP Tags to 'PHP long tag'; no need to add PHP file extension the default list fulfill the project needs. Check the Filtering option, all the files with extension correspond to {filtering file extension list}, will be ignored (not compiled, not copied).

e. Setting the License Parameters

PhPCryptor main task is to compile the sources to byte code that don't allow any access to the source code. This section allow the developer or any source code owner to push forward and take full control of his intelectual proprties, where and when his sources will work. For the current project, just basic security is required, no time limit and no binding.
output directory
Project ID :
Project ID identify the items of the same project; the default setting init the parameter.
To custome the value, click Generate ID and follow the instructions.
PS. this parameter is synchronized with the option ESS 'Encoded Script Security'.
Project Key :
Type a proper project key. This parameter is used to encode and decode the project items.
PS. if the parameter is kept empty or unchanged from default an error message is generated when attempting to compile the project.
E.S.S :
This option only selected if you expect to run project compiled with the same Project ID; Otherwise error message is generated when decoding.
Code Expiracy:
Uncheck the option.
The project will work without time limit.
Bind to IP:
Uncheck the option.
The project will work at any http server IP address.
Bind to domain name:
Uncheck the option.
The project will work at any http server domain name.

f. Setting the Decoder Parameters

This section allow the project owner when deployed, running smoothly and to keep informed the users, the professional and the server administrator.
output directory
For the project, we need to update the MSG_CONTACT and keep all the default message configuration unchanged.
Select MSG_CONTACT and click edit button > input the e-mail address for the project administrator > click OK to confirm the changes and close the dialog box.

g. Save the Project

Before compiling save the project. Saving the project the first time is accomplished in two steps.

Step 1: Set the file name.

Click Save topic from menu or toolbar to display save as dialog box.

from application menu :
Files > Save
from toolbar : click Save button add item
save project

Set the the file name and close the Save As dialog box. A second dialog box is displayed to supervise the saving process.

Step 2: Set the password to protect the saved project file and close dialog box.
save project

h. Compile the Project

To compile the current project, click Compile topic from menu or toolbar to launch the compiling process.

from application menu :
Project > Compile
from toolbar : click Compile button add item
save project

After starting compilation. The application bring Encode Project Tab to the front to allow supervising the compilation. For long project, the Tab allow to set the process priority, suspend, resume and abort the process.

For each item processed, a message is displayed in both Tab window and Log window.

3. Explore the Compiled Project

x. Compiled Project

During this chapter, using a real project as an exercise you'll learn step by step, how to create a project, add the items, setting the output directory, setting encoding parameters, setting licensing parameters, customize the decoding error messages, compile the project and finally explore the results.
To setup and compile project with PhPCryptor, only two steps are required, (1) specify the input sources and (2) setup the Project Key from License Parameters dialog. All the other parameters are optional; The default parameters setting fulfill the need for the most projects.
  • A - Explore the results.
  • B - Understanding the output.

a. Explore the Output Directory

To explore the compiled project, click Display Output topic from menu or toolbar to launch the compiling process.

from application menu :
Project > Display Output
from toolbar : click Display Output button PhPCryptor Open Compiled Directory
PhPCryptor Compiled Items

To prevent any name colision with output compiled project, the application wrap each compiled project within ID directory CRY_*.

Exploring the output path : e:\Projects_web\output, selected as output compiled directory; The current compiled results are set inside a new directory CRY_20171025_155809, which we name it CRY_ID

    The directory CRY_ID contains :
  • Compiled project directory SRC_20171025_153900.
  • Decoder system directory - phpcryptor_bin.
  • Processing log - Processing_Log.txt.
  • Decoder configuration file - phpcryptor.ini
Check the processing log for processing notices or errors. If any, set the configuration as recommanded and reprocess the project. A new CRY_ID is generated for each processing.

b. Understanding the output items

src project

Exploring the output path : e:\Projects_web\output, selected as output compiled directory;
The results are set inside a new directory CRY_20171025_155809, which we name it CRY_ID

    The directory CRY_ID contains, two (02) directories and two (02) files
  • Compiled project directory 'SRC_20171025_153900'.
  • Decoder system directory 'phpcryptor_bin'.
  • Processing log file 'Processing_Log.txt'.
  • Decoder configuration file 'phpcryptor.ini'.

b.1 - Compiled Items directory 'SRC_*'

compiled project
The directory contains the compiled project, the structure of the output are identical to the input source.

b.2 - phpcryptor_bin directory items

compiled project
Decoder directory; move this directory 'AS IS' without altering the contents to the root of http server for the default configuration or use phpcryptor.ini to custumize the paths.

b.2.1 - PhPCryptor Universal Decoder

phpcryptor_bin ud
PhPCryptor Universal Decoder Directory; Do Not Alter the Contents.

b.2.2 - PhPCryptor Project License

phpcryptor_bin licenses
The external license are generated anytime when you compile a project; ignore the file if you select embeded license.


4. Deploy the Compiled Project

x. Deploy a Compiled Project - intro

These sections describe how to deploy and configure the compiled project.
  • a. Deploy a compiled project.
  • b. Configuration file setting.

a. Deploy a Compiled Project

After compiling a project with PhPCryptor, the output results are composed of four parts:
SRC_ID :Compiled Project Wrap Directory
phpcryptor_bin :Decoder Directory
phpcryptor.ini :PhPCryptor Decoder configuration file
Processing_Log.txt :Processing log file
phpcryptor output phpcryptor compiled project

The compiled project have the same repartition as the source project. To run the compiled project, move the compiled project and phpcryptor_bin to your http server.

phpcryptor_bin directory must be in the path of the http root or his parent path.

ex: if the http root directory is defined as :

/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/webroot

The valid paths are :

/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/webroot/phpcryptor_bin
/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/phpcryptor_bin
/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/phpcryptor_bin
/dir1/dir2/dir3/dir4/dir5/dir6/dir7/phpcryptor_bin
/dir1/dir2/dir3/dir4/dir5/dir6/phpcryptor_bin
/dir1/dir2/dir3/dir4/dir5/phpcryptor_bin
/dir1/dir2/dir3/dir4/phpcryptor_bin
/dir1/dir2/dir3/phpcryptor_bin
/dir1/dir2/phpcryptor_bin
/dir1/phpcryptor_bin

The file phpcryptor.ini is provided to customize the decoder directory path, licenses path and take a full control to decoding process. The next section describe how to use the configuration file.

b. Setting a Configuration File

Configuration file allow to customize, phpcryptor_bin name and the path, the license path, enable or disable decode message errors and the action to take in fatal error cases.
Under the section phpcryptor_01, four keys are used to configure the phpcryptor decoder.
  1. 'path' : full path to phpcryptor_bin directory.
  2. 'path_lic' : (optional) full path to phpcryptor_lic directory.
  3. 'error_display' : Display Decoder errors or Silent Mode
  4. 'error_fatal' : Action to take.
default bin path config file setting
  • Move phpcryptor_bin to specified location, where your http server can access with fully access right (r, w & x).
  • Edit phpcryptor.ini
    • Setup the 'path' key pointing to phpcryptor_bin directory.
    • Setup the 'path_lic key to point to phpcryptor_lic location (optional).
    • Setup error_display key, the default setting (Silent mode).
    • Setup error_fatal key, the default setting (No Action).
  • Move phpcryptor.ini to the http server root or its parents.
  • Run your compiled project for tests.
Important Notices:
  1. Running compiled project without configuration file, is time consumming. The configuration file is a best way to speed significantly the decode process and must be located in the http root or its parents directories.
  2. The path if defined must be valid otherwise Error message is generated.
  3. DO NOT alter in any case the name and the content of the license file also DO NOT edit or alter any file from phpcryptor_bin directory. Doing so, may compromize the decode process.
  4. If any file are edited by mistake DO NOT save it.


PhPCryptor, User Manual v1.20
BorjTek© Copyright 2006-2025 All Rights Reserved
BorjTek© Trademark of Borj Software Inc.