Skip to content

Commit 94eb64c

Browse files
authored
Update README.md
1 parent cced0d9 commit 94eb64c

1 file changed

Lines changed: 98 additions & 15 deletions

File tree

README.md

Lines changed: 98 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,115 @@
1-
# Laravel Source Encrypter
2-
3-
[![StyleCI](https://github.styleci.io/repos/248479627/shield?branch=master)](https://github.styleci.io/repos/248479627)
4-
[![Latest Stable Version](https://poser.pugx.org/sbamtr/laravel-source-encrypter/v/stable)](https://packagist.org/packages/sbamtr/laravel-source-encrypter)
5-
[![License](https://poser.pugx.org/sbamtr/laravel-source-encrypter/license)](https://github.com/SiavashBamshadnia/Laravel-Source-Encrypter)
6-
[![CodeFactor](https://www.codefactor.io/repository/github/siavashbamshadnia/laravel-source-encrypter/badge)](https://www.codefactor.io/repository/github/siavashbamshadnia/laravel-source-encrypter)
1+
# Laravel Source Encrypter for Laravel and Lumen 6, 7, 8, 9, 10 , 11
72

3+
[![License](https://poser.pugx.org/rezgui/laravel-source-encrypter/license)](https://github.com/rezgui/Laravel-Source-Encrypter)
4+
[![Latest Stable Version](https://poser.pugx.org/rezgui/laravel-source-encrypter/v/stable)](https://packagist.org/packages/rezgui/laravel-source-encrypter)
5+
[![CodeFactor](https://www.codefactor.io/repository/github/rezgui/laravel-source-encrypter/badge)](https://www.codefactor.io/repository/github/rezgui/laravel-source-encrypter)
6+
[![PHP Version Require](https://poser.pugx.org/rezgui/laravel-source-encrypter/require/php)](https://packagist.org/packages/rezgui/laravel-source-encrypter)
7+
[![Total Downloads](https://poser.pugx.org/rezgui/laravel-source-encrypter/downloads)](https://packagist.org/packages/rezgui/laravel-source-encrypter)
88

99
![](cover.jpg)
1010

1111
This package encrypts your php code with [phpBolt](https://phpbolt.com)
1212

13-
*For Laravel and Lumen 6, 7, 8, 9, 10 , 11
14-
15-
* [Installation](#installation)
13+
* [Introduction](#introduction)
14+
* [Benifits of Encoding](#benifits-of-encoding)
15+
* [phpBolt encoder](#phpbolt-encoder)
16+
* [Guide](#guide)
17+
* [Installation Package](#installation-package)
1618
* [Usage](#usage)
1719

18-
## Installation
20+
---
1921

20-
### Step 1
21-
At the first, You have to [install phpBolt](https://phpbolt.com/download-phpbolt/).
22+
## Introduction
2223

24+
Many PHP developers need to protect their application source code before they distribute it to their customers and make it difficult for others to modify it without their permission.
2325

24-
### Step 2
26+
- There are couple of techniques to protect PHP source code:
27+
28+
- Making the code difficult to read – which involves in minification & obfuscation
29+
30+
- **Encoding the source code.**
31+
32+
- There are list of commercial PHP encoders (Zend, ionCube, SourceGuardian, NuCoder, etc).
33+
34+
- A free encoder called **phpBolt** saves you from buying commercial encoders. phpBolt helps to protect your PHP source code by encrypting and decrypting code using a key.
35+
36+
### Benifits of Encoding
37+
38+
- Anyone can reuse your PHP script to any web server or localhost. phpBolt will encrypt your source code with a key.
39+
- Advance Protection -- Generate a specific key for each customer.
40+
- Online Encryption -- Encrypt source code from online also possible.
41+
- Encrypt PHP source code and obfuscate the PHP source code.
42+
- Prevent your PHP product from the nulled world.
43+
44+
## phpBolt encoder
45+
46+
- The author doesn't care about issues! The author will help you only if you pay for that. (he cannot provide free support)
47+
- phpBolt loader is an extension used to load PHP files protected and encoded using PHP encoder.
48+
49+
### Guide
50+
51+
1. **Download phpBolt extension for 64-bit System**
52+
53+
- In order to use phpBolt, you need to [download loader extension](https://phpbolt.com/download-phpbolt/). Look for `bolt.so` inside the corresponding platform folder. ([extension](./assets/phpBolt-extension-1.0.5.zip))
54+
55+
- Or, directly using following wget command:
56+
57+
```bash
58+
cd /tmp
59+
wget https://phpbolt.com/wp-content/uploads/2024/03/phpBolt-extension-1.0.5.zip
60+
```
61+
62+
- Then unzip the downloaded file using the unzip command and move into the decompressed folder.
63+
64+
- This is a mandatory step. Because PHP engine needs to identify then functions `bolt_encrypt` and `bolt_decrypt` functions.
65+
66+
2. **Install bolt.so extension for PHP**
67+
68+
- There will be different phpBolt loader files for various PHP versions, you need to select the right phpBolt loader for your installed PHP version on your server.
69+
70+
- Next, find the location of the extension directory for PHP version **8.2.25** (for example), it is where the phpBolt loader file will be installed. The specified directory from the output of this command:
71+
72+
```sh
73+
php -i | grep extension_dir
74+
# output:
75+
# extension_dir => /usr/lib/php/20220829 => /usr/lib/php/20220829
76+
```
77+
78+
- Copy `bolt.so` from the respective platform folder into the folder where all PHP extensions are stored. In my case, `/usr/lib/php/20220829` was the folder that stores all PHP extensions.
79+
80+
3. **Configure phpBolt Loader for PHP**
81+
82+
- Find the `php.ini` file and add `extension='/usr/lib/php/20220829/bolt.so'` in `php.ini` file. Then restart your server. Please choose correct `bolt.so` file. `bolt.so` is diffrent for each version and OS.
83+
84+
- Open `php.ini` as following: `sudo nano /etc/php.ini`
85+
86+
- Add `blot.so` extension: `extension='/absolute-path/bolt.so'`
87+
88+
- __Note:__
89+
```text
90+
You will be encrypting using CLI,
91+
then you have to add extension in: `/etc/php/8.2/cli/php.ini` file,
92+
and in: `php/8.2/apache2/php.ini` file to decode the source code.
93+
(**Don't forget to restart server**)
94+
idem for FPM
95+
```
96+
97+
- Remember to replace absolute-path with the path of the extension. In my case: `extension='/usr/lib/php/20220829/bolt.so'`
98+
99+
- Now we need to restart the Apache, Nginx, or php-fpm web server for the phpBolt loaders to come into effect.
100+
101+
- Now you have successfully setup bolt loader extension.
102+
103+
104+
105+
## Installation Package
106+
107+
### Step 1
25108
Require the package with composer using the following command:
26109
```bash
27110
composer require --dev rezgui/laravel-source-encrypter
28111
```
29-
### Step 3
112+
### Step 2
30113
#### For Laravel
31114
The service provider will automatically get registered. Or you may manually add the service provider in your `config/app.php` file:
32115
```php
@@ -43,7 +126,7 @@ $app->register(\rezgui\LaravelSourceEncrypter\SourceEncryptServiceProvider::clas
43126
```
44127
45128
46-
### Step 4 (Optional)
129+
### Step 3 (Optional)
47130
You can publish the config file with this following command:
48131
```bash
49132
php artisan vendor:publish --provider="rezgui\LaravelSourceEncrypter\SourceEncryptServiceProvider" --tag=config

0 commit comments

Comments
 (0)