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

ActiveLibrary[Security](/categories/security)

shizzo91/crypto
===============

From symmetric to hybrid encryption, everything is possible. There is symmetric encryption, asymmetric encryption, multiple asymmetric encryption, hybrid encryption and multiple hybrid encryption.

00PHP

Since Sep 17Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Crypto
======

[](#crypto)

Symmetrical
-----------

[](#symmetrical)

### usage

[](#usage)

```
    // encoding
    $password = "password";
    $symmetricalCrypto = new SymmetricalCrypto($password);
    $encoded = $symmetricalCrypto->encode("Stringable or string");

    // decoding
    $password = "password";
    $symmetricalCrypto = new SymmetricalCrypto($password);
    $decode = $symmetricalCrypto->decode($encoded);
```

Asymmetric or Hybrid
--------------------

[](#asymmetric-or-hybrid)

### create a RSA key

[](#create-a-rsa-key)

```
# Private key generation (with passphrase)
openssl req -new -nodes -sha512 -newkey rsa:2048 -keyout private.pem
# Private key generation (without passphrase)
openssl req -nodes -new -x509 -keyout private.pem
# Public key extraction
openssl rsa -in private.pem -pubout -out public.pem
```

### usage for simple asymmetric

[](#usage-for-simple-asymmetric)

```
    $privateSimpleCrypto = new PrivateSimpleCrypto(
        "../private-2.pem", // file or text
        "passphrase" // passphrase optional
    );
    $encoded = $privateSimpleCrypto->encode("Stringable or string");

    $publicSimpleCrypto = new PublicSimpleCrypto(
        "../public-2.pem" // file or text
    );
    $decode = $publicSimpleCrypto->decode($encoded);
```

### usage for double asymmetric

[](#usage-for-double-asymmetric)

```
    // simple
    // encoding
    $privateSimpleCrypto = new PrivateSimpleCrypto(
        "../private-2.pem", // file or text
        "passphrase" // passphrase optional
    );
    $encoded = $privateSimpleCrypto->encode("Stringable or string");

    // decoding
    $publicSimpleCrypto = new PublicSimpleCrypto(
        "../public-2.pem" // file or text
    );
    $decode = $publicSimpleCrypto->decode($encoded);

    // double
    // encoding
    $myPrivateKey = new PrivateSimpleCrypto("../private.pem");
    $receiverPublicKey = new PublicSimpleCrypto("../public-2.pem");
    $doubleCrypto = new DoubleCrypto(
        $receiverPublicKey,
        $myPrivateKey
    );
    $encoded = $doubleCrypto->encode("Stringable or string");

    // decoding
    // with text as key
    $receiverPrivateKey = "-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----";
    $myPublicKey = "../public.pem";

    $doubleCryptoReceiver = DoubleCrypto::create($myPublicKey, $receiverPrivateKey, "secret");
    $decoded = $doubleCryptoReceiver->decode($encoded);
    var_dump($decoded); // "Stringable or string"
```

### usage for hybrid

[](#usage-for-hybrid)

```
    // simple
    // encoding
    $simpleHybridPrivate = HybridCrypto::createPrivateSimple("password", "../private.pem");
    $encoded = $simpleHybridPrivate->encode("Stringable or string");

    // decoding
    $simpleHybridPublic = HybridCrypto::createPublicSimple("password", "../public.pem");
    $decoded = $simpleHybridPublic->encode($encoded);

    // double
    // encoding
    $doubleHybridTransmitter = HybridCrypto::createDouble(
        "password",
        "../public-2.pem",
        "../private.pem"
    );
    $encoded = $doubleHybridTransmitter->encode("Stringable or string");

    // decoding
    $doubleHybridReceiver = HybridCrypto::createDouble(
        "password",
        "../public.pem",
        "../private-2.pem",
        "passphrase"
    );
    $decoded = $doubleHybridReceiver->encode($encoded);
```

###  Health Score

12

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 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/227e185e808348965e385d05d112fb9f2ecd7d5b073f032f4430a54bfd3eba63?d=identicon)[shizzo91](/maintainers/shizzo91)

---

Top Contributors

[![Shizzo91](https://avatars.githubusercontent.com/u/21262827?v=4)](https://github.com/Shizzo91 "Shizzo91 (29 commits)")

### Embed Badge

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

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/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.7M113](/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)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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