PHPackages                             lleocastro/encryptor - 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. lleocastro/encryptor

ActiveLibrary[Security](/categories/security)

lleocastro/encryptor
====================

Encrypting values such as passwords and short messages

08PHP

Since Nov 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/lleocastro/encryptor)[ Packagist](https://packagist.org/packages/lleocastro/encryptor)[ RSS](/packages/lleocastro-encryptor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Simple Data Encryption
======================

[](#simple-data-encryption)

[![Build Status](https://camo.githubusercontent.com/701b6ec0970cd8aa6a64e511e85619f61d83930018e87fd1f657cfe3e8f380b3/68747470733a2f2f7472617669732d63692e6f72672f6477796c2f657374612e7376673f6272616e63683d6d6173746572)](https://twitter.com/leobcastro94)[![codecov.io Code Coverage](https://camo.githubusercontent.com/334b7ab3c441380aebf71050ee4d1eb697e6df8c11df387bb37a2cef24d6452a/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6477796c2f686170692d617574682d6a7774322e7376673f6d61784167653d32353932303030)](https://github.com/lleocastro/encryptor/tree/master/tests)[![contributions welcome](https://camo.githubusercontent.com/9e93e892d0685e1bf7a1d0bd7c8410d6ecf2086a0a7b48dd58a6b96fa556ea2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/lleocastro/encryptor/issues)

> "Module developed for my framework "[Genniuz](https://github.com/lleocastro/genniuz-framework)", but works perfectly independent of the framework.

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

[](#installation)

> It's recommended that you use Composer to install Encryptor.

```
composer require lleocastro/encryptor
```

---

This suite contains three types of data encryption!
---------------------------------------------------

[](#this-suite-contains-three-types-of-data-encryption)

Click on any link to go a method-specific documentation.

- [Hash Generator](https://github.com/lleocastro/encryptor/blob/master/Docs/HashGenerator.md)
- SMCrypter
- Disguise

### 1. Hash Generator

[](#1-hash-generator)

> 107 bits hash for passwords encryption and things that do not need to have their values retrieved later, only their hash for comparison

```
//Construct the HashGenerator
$hash = new HashGenerator();

//Data input
$data = "Hello World!";

//Data Encrypted
$encryptedData = $hash->encode($data);
//Output: "kFMZV3TGpVTWpnVIZFMs9GTqZldOtGZzZlbGt2VsRWWX1WNO5kbohlSEpEaKRUQ0oUR1UkVUJlTSd0c6RlbwpUTVVTVaNDcQZVMrhHVpVzT";

//Hashs comparables
$check = $hash->isEquals("Hello World!", $encryptedData);
//Output: true;
```

### 2. Message Encrypter

[](#2-message-encrypter)

> Encrypt messages with a symmetric key using a simple crazy calculation and a bit of obscurity. Tested only with small messages..

```
//Construct the SMCrypter
$smCrypt = new SMCrypter();

//Data input
$originalValue = "My EMAIL is 'leonardo_carvalho@outlook.com' and (10+5/2*7=0999) ";

//Generate symmetric key
$key = $smCrypt->keyGenerator();
//Output: VE4zWXpOPT1RTjBr

//Encrypted
$encoded = $smCrypt->encode($key, $originalValue);
/**
 * Output: 591047765 928789345 268658075 253306185 529640205 591047765 498936425 560343985 583371820 268658075 253306185
 * 805974225 882733675 268658075 253306185 299361855 829002060 775270445 852029895 844353950 744566665 875057730 767594500
 * 852029895 729214775 759918555 744566665 875057730 905761510 744566665 829002060 798298280 852029895 491260480 852029895
 * 898085565 890409620 829002060 852029895 852029895 821326115 353093470 759918555 852029895 836678005 299361855 268658075
 * 253306185 744566665 844353950 767594500 268658075 253306185 307037800 376121305 368445360 330065635 406825085 360769415
 * 383797250 322389690 422176975 468232645 368445360 437528865 437528865 437528865 314713745 268658075 253306185 291685910
 * 829002060 890409620 452880755 291685910 790622335 890409620 452880755 291685910 829002060 890409620 452880755 752242610
 * 775270445 759918555 744566665 898085565 882733675 775270445 268658075 253306185 928789345 775270445 882733675 353093470
 * 268658075 253306185 291685910 759918555 759918555 775270445 767594500 805974225 829002060 452880755 291685910 514288315
 * 759918555 775270445 767594500 805974225 829002060 452880755 291685910 790622335 890409620 452880755
 */

//Decrypted
$decoded = $smCrypt->decode($key, $encoded);
//Output: "My EMAIL is 'leonardo_carvalho@outlook.com' and (10+5/2*7=0999) ";
```

### 3. Disguise

[](#3-disguise)

> Encrypts and decrypts texts in base64 with some trick and manipulation for strings make a encryption obscure and simple

```
//Construct the Disguise
$disguise = new Disguise();

//Data input
$data = "This is a Rock ´N Roll..";

//Data Encrypted
$encrypt = $disguise->obscure($data);
//Output: "Mll2SkZJaEJ5Y3BCeWNwaEdWPT1nTHV3R2J2SkZJT1Jyd2dz";

//Decrypted
$decrypt = $disguise->illumin($encrypt);
//Output: "This is a Rock ´N Roll..";
```

---

Learn More
----------

[](#learn-more)

> This readme is just a preview, for more information access the readme of each method..

- [Hash Generator](https://github.com/lleocastro/encryptor/blob/master/Docs/HashGenerator.md)
- SMCrypter
- Disguise

#### Security

[](#security)

> This code is secure counter cross-site scripting (XSS).

If you discover security related issues, please email [leonardo\_carvalho@outlook.com](mailto:leonardo_carvalho@outlook.com) instead of using the issue tracker.

#### To contributions

[](#to-contributions)

Please, see [doc for contribute](https://github.com/lleocastro/encryptor/blob/master/CONTRIBUTE.md). Thanks!

#### License

[](#license)

The Encryptor is licensed under the MIT license. See [License File](https://github.com/lleocastro/encryptor/blob/master/LICENSE) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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.

### Community

Maintainers

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

---

Top Contributors

[![lex0c](https://avatars.githubusercontent.com/u/16158638?v=4)](https://github.com/lex0c "lex0c (67 commits)")

### Embed Badge

![Health badge](/badges/lleocastro-encryptor/health.svg)

```
[![Health](https://phpackages.com/badges/lleocastro-encryptor/health.svg)](https://phpackages.com/packages/lleocastro-encryptor)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M212](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M112](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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