PHPackages                             oyedele/crypto-helper - 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. oyedele/crypto-helper

ActiveLibrary[Security](/categories/security)

oyedele/crypto-helper
=====================

This is a Laravel/PHP helper function for encryption and decryption of data using OPENSSL

v1.0.0(8mo ago)0190↓50%MITPHPPHP &gt;=8.0

Since Sep 9Pushed 6mo agoCompare

[ Source](https://github.com/itz4mesays/CryptoHelper)[ Packagist](https://packagist.org/packages/oyedele/crypto-helper)[ RSS](/packages/oyedele-crypto-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Crypto Helper
=============

[](#crypto-helper)

A lightweight PHP/Laravel package for handling **encryption** and **decryption** with OpenSSL. Supports both **Laravel integration** (via Service Provider &amp; config publishing) and **standalone PHP usage**.

---

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

[](#installation)

### 1. Require the package via Composer

[](#1-require-the-package-via-composer)

```
composer require oyedele/crypto-helper
```

### 2. (Laravel Only) Register the Service Provider

[](#2-laravel-only-register-the-service-provider)

If you are using **Laravel 5.5+**, the service provider is auto-discovered. For older versions, add the following to `config/app.php`:

```
'providers' => [
    // ...
    Oyedele\CryptoHelper\CryptoHelperServiceProvider::class,
];
```

### 3. (Laravel Only) Publish the Config

[](#3-laravel-only-publish-the-config)

```
php artisan vendor:publish --tag=config
```

This will create a file at:

```
config/crypto-helper.php

```

Default config:

```
return [
    'cipher'  => 'AES-128-ECB',
    'options' => OPENSSL_RAW_DATA,
];
```

---

⚡ Usage
-------

[](#-usage)

### Laravel Example

[](#laravel-example)

```
use Oyedele\CryptoHelper\CryptoHelper;

// Encrypt
$encrypted = CryptoHelper::encrypt('my-secret-data', 'my-secret-key');

// Decrypt
$decrypted = CryptoHelper::decrypt($encrypted, 'my-secret-key');

echo $decrypted; // "my-secret-data"
```

You can also set the default key in `config/crypto-helper.php` or at runtime:

```
config(['crypto-helper.key' => 'my-default-key']);

$encrypted = CryptoHelper::encrypt('data'); // uses default key
```

---

### Standalone PHP Example

[](#standalone-php-example)

When using outside Laravel, configuration falls back to the built-in `Config` class.

```
require 'vendor/autoload.php';

use Oyedele\CryptoHelper\Config;
use Oyedele\CryptoHelper\CryptoHelper;

// Set encryption key globally
Config::set('key', 'my-standalone-key');

// Encrypt
$encrypted = CryptoHelper::encrypt('standalone-data');

// Decrypt
$decrypted = CryptoHelper::decrypt($encrypted);

echo $decrypted; // "standalone-data"
```

---

Configuration Options
---------------------

[](#configuration-options)

KeyDescriptionDefault`cipher`OpenSSL cipher algorithm`AES-128-ECB``options`OpenSSL options (e.g., `OPENSSL_RAW_DATA`)`OPENSSL_RAW_DATA``key`Encryption key (set manually or via config)`null`---

Testing
-------

[](#testing)

Run PHPUnit tests:

```
vendor/bin/phpunit
```

---

Package Structure
-----------------

[](#package-structure)

```
crypto-helper/
├── config/
│   └── crypto-helper.php       # Default config
├── src/
│   ├── Config.php              # Standalone config manager
│   ├── CryptoHelper.php        # Core encryption/decryption
│   └── CryptoHelperServiceProvider.php # Laravel provider
├── tests/
│   └── CryptoHelperTest.php    # PHPUnit tests
└── README.md

```

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance67

Regular maintenance activity

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

242d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11642869?v=4)[Olufemi Oyedele](/maintainers/itz4mesays)[@itz4mesays](https://github.com/itz4mesays)

---

Top Contributors

[![itz4mesays](https://avatars.githubusercontent.com/u/11642869?v=4)](https://github.com/itz4mesays "itz4mesays (1 commits)")[![official-oyedele](https://avatars.githubusercontent.com/u/104019744?v=4)](https://github.com/official-oyedele "official-oyedele (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oyedele-crypto-helper/health.svg)

```
[![Health](https://phpackages.com/badges/oyedele-crypto-helper/health.svg)](https://phpackages.com/packages/oyedele-crypto-helper)
```

###  Alternatives

[illuminate/encryption

The Illuminate Encryption package.

9229.7M277](/packages/illuminate-encryption)[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[genealabs/laravel-governor

Managing policy and control in Laravel.

201262.8k](/packages/genealabs-laravel-governor)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)[ercsctt/laravel-file-encryption

Secure file encryption and decryption for Laravel applications

642.6k](/packages/ercsctt-laravel-file-encryption)[laragear/poke

Keep your forms alive, avoid TokenMismatchException by gently poking your Laravel app

2211.5k](/packages/laragear-poke)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
