PHPackages                             chrisvpearse/code-encrypter-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. chrisvpearse/code-encrypter-laravel

ActiveLibrary[Security](/categories/security)

chrisvpearse/code-encrypter-laravel
===================================

A code encrypter for the Laravel framework.

v0.1.0(2y ago)882MITPHPPHP ^8.1

Since Dec 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/chrisvpearse/code-encrypter-laravel)[ Packagist](https://packagist.org/packages/chrisvpearse/code-encrypter-laravel)[ Docs](https://github.com/chrisvpearse/code-encrypter-laravel)[ RSS](/packages/chrisvpearse-code-encrypter-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

A Code Encrypter for the Laravel Framework
==========================================

[](#a-code-encrypter-for-the-laravel-framework)

The goal of this open source package is **security *through* obscurity**.

It aims to offer an alternative to delivering your closed source projects in **plain text**. Instead, you can opt to deliver your files **encrypted**, alongside a binary PHP extension which will decrypt them on the fly.

This package uses symmetric encryption, which means that the key itself *has* to be embedded within the binary PHP extension. However, the code for the extension which holds the key and handles the decryption is open source (and is included within this package).

The key is generated by you and only known to you (as the developer). It can be unique per project and/or customer which opens up the possibility of additional functionality later down the line, such as setting expiry dates (for free trials) and/or whitelisting by IP/MAC address.

Requirements
------------

[](#requirements)

1. macOS
2. PHP 8.1
3. [Laravel 10](https://laravel.com)
4. [Zephir](https://zephir-lang.com)

Installation
------------

[](#installation)

The below assumes that you're currently in your application's root directory.

```
$ composer require chrisvpearse/code-encrypter-laravel
```

### Publish the Config File

[](#publish-the-config-file)

```
$ php artisan vendor:publish --tag=code-encrypter-config
```

### Zephir Quickstart

[](#zephir-quickstart)

You should be able to get started with Zephir by downloading the [latest release PHAR](https://github.com/zephir-lang/zephir/releases) from GitHub, followed by these commands:

```
$ cd ~ && pecl install zephir_parser
```

```
$ cd ~/Downloads && mv zephir.phar /usr/local/bin/zephir && chmod +x /usr/local/bin/zephir
```

A "Hello, World!" Walkthrough
-----------------------------

[](#a-hello-world-walkthrough)

Again, the below assumes that you're currently in your application's root directory.

### Make an Invokable Controller

[](#make-an-invokable-controller)

```
$ php artisan make:controller HelloWorld --invokable
```

📄 **./app/Http/Controllers/HelloWorld.php**

```
