PHPackages                             rnr1721/le7-cryptography - 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. rnr1721/le7-cryptography

ActiveLibrary[Security](/categories/security)

rnr1721/le7-cryptography
========================

Cryptography is a lightweight PHP library designed for password encryption, decryption, verification, and random password generation. This library is dependency-free, requiring only the PHP OpenSSL extension

1.0.0(2y ago)010MITPHPPHP &gt;=8.0

Since May 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rnr1721/le7-cryptography)[ Packagist](https://packagist.org/packages/rnr1721/le7-cryptography)[ RSS](/packages/rnr1721-le7-cryptography/feed)WikiDiscussions main Synced 1mo ago

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

le7-cryptography
================

[](#le7-cryptography)

Le7 Cryptography is a lightweight PHP library designed for password encryption, decryption, verification, and random password generation. This library is dependency-free, requiring only the PHP OpenSSL extension

A small PHP library designed for encrypting, decrypting, verifying passwords, and generating random passwords securely. It relies solely on PHP's OpenSSL extension and has no additional dependencies.

Features
--------

[](#features)

- Strong Encryption: Utilizes OpenSSL for robust password encryption and decryption using various algorithms such as AES-128, AES-192, AES-256, and DES-EDE3.
- Password Generation: Generates random passwords of customizable lengths, allowing you to specify the character set for password generation.
- Password Verification: Verifies whether a provided password matches a previously encrypted password, ensuring secure authentication.

Requires
--------

[](#requires)

- PHP 8.0 or higher
- PHP ext-openssl
- composer

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

[](#installation)

To install the Cryptography Library, simply clone the repository or download the source files and include them in your PHP project.

```
git clone https://github.com/username/repository.git
```

Usage
-----

[](#usage)

You can specify the key directly when creating the class object, or use a custom one for each encryption/decryption operation.

```
// Include the Cryptography class
use rnr1721\Core\Cryptography;

// Initialize Cryptography with a key and method (optional)
$crypto = new Cryptography('your_secret_key', 'AES-256-CBC');

// Encrypt a password
$encryptedPassword = $crypto->encryptPassword('my_password');

// Decrypt an encrypted password
$decryptedPassword = $crypto->decryptPassword($encryptedPassword);

// Generate a random password
$randomPassword = $crypto->generateRandomPassword();

// Verify a password against its encrypted counterpart
$isPasswordValid = $crypto->verifyPassword('my_password', $encryptedPassword);
```

Or you can use key for each operations

```
// Include the Cryptography class
use rnr1721\Core\Cryptography;

// Initialize Cryptography with a key and method (optional)
$crypto = new Cryptography();

// Encrypt a password
$encryptedPassword = $crypto->encryptPassword('my_password','your_secret_key','AES-256-CBC');

// Decrypt an encrypted password
$decryptedPassword = $crypto->decryptPassword($encryptedPassword,'your_secret_key','AES-256-CBC');

// Generate a random password. Length is optional, default is 7
$randomPassword = $crypto->generateRandomPassword(7);

// Verify a password against its encrypted counterpart
$isPasswordValid = $crypto->verifyPassword('my_password', $encryptedPassword,'your_secret_key','AES-256-CBC');
```

Also you can set symbols, allowed for random password generation

```
// Include the Cryptography class
use rnr1721\Core\Cryptography;

// Initialize Cryptography with a key and method (optional)
$crypto = new Cryptography('your_secret_key', 'AES-256-CBC');

$crypto->setDefaultPasswordChars('abcdefgh');

$newPassword = $crypto->generateRandomPassword(5);
```

And you can get array of allowed methods

```
// Include the Cryptography class
use rnr1721\Core\Cryptography;
$crypto = new Cryptography('your_secret_key', 'AES-256-CBC');
$allowedMethods = $crypto->getAllowedMethods();
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit bug reports, feature requests, or pull requests. For major changes, please open an issue first to discuss the proposed changes.

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

736d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b056f4160d8f9302378726a35860b42bfa67c29760bb55fcacddfde2bfa6f6ac?d=identicon)[rnr1721](/maintainers/rnr1721)

---

Top Contributors

[![rnr1721](https://avatars.githubusercontent.com/u/122087344?v=4)](https://github.com/rnr1721 "rnr1721 (3 commits)")

---

Tags

cryptographyopensslcomponentpasswords

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rnr1721-le7-cryptography/health.svg)

```
[![Health](https://phpackages.com/badges/rnr1721-le7-cryptography/health.svg)](https://phpackages.com/packages/rnr1721-le7-cryptography)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[paragonie/ciphersweet

Searchable field-level encryption library for relational databases

4641.2M21](/packages/paragonie-ciphersweet)[unicodeveloper/laravel-password

Protect your users from entering dumb and common passwords

4261.4M2](/packages/unicodeveloper-laravel-password)[simplito/elliptic-php

Fast elliptic curve cryptography

2312.2M254](/packages/simplito-elliptic-php)[vlucas/pikirasa

PKI public/private RSA key encryption using the OpenSSL extension

104101.1k1](/packages/vlucas-pikirasa)

PHPackages © 2026

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