PHPackages                             sivin/crypt - 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. sivin/crypt

ActiveLibrary[Security](/categories/security)

sivin/crypt
===========

Small library for encryption via phpseclib

v2.1(5y ago)117.2k—3.6%1MITPHPPHP &gt;= 7.1

Since Apr 30Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (5)Used By (0)

crypt
=====

[](#crypt)

Small library for encryption via [phpseclib](https://github.com/phpseclib/phpseclib)

[![Build Status](https://camo.githubusercontent.com/078d9a35c40733ddaa325c77bae32c7ac7c5d4bd7840e4d1fdd390e8593e5ef2/68747470733a2f2f7472617669732d63692e6f72672f536956694e2f63727970742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/SiViN/crypt)[![License](https://camo.githubusercontent.com/21e9f1f7c3011cc531c966cb08324179f91dccc0b54180de3c2da40824da8da9/68747470733a2f2f706f7365722e707567782e6f72672f736976696e2f63727970742f6c6963656e7365)](https://packagist.org/packages/sivin/crypt)[![Total Downloads](https://camo.githubusercontent.com/73171d25b7594ca0c493c3b02f0e352c8bf1ec17cfd0a7e8df11a18de774af59/68747470733a2f2f706f7365722e707567782e6f72672f736976696e2f63727970742f646f776e6c6f616473)](https://packagist.org/packages/sivin/crypt)

1. Install via composer

    ```
    composer require sivin/crypt
    ```
2. Register extension in `config.neon`:

    ```
    extensions:
    	crypt: SiViN\Crypt\DI\CryptExtension
    ```
3. Create or use your key/s:

    ```
    /** @var Crypt */
    private $crypt;

    public function __construct(Crypt $crypt)
    {
    	$this->crypt = $crypt;
    }
    ...
    $keys = $this->crypt->createKeyPair()
    $privateKeyRaw = $keys['privateKeyRaw'];
    $publicKeyRaw = $keys['publicKeyRaw'];
    ```
4. Use your own key or define it in a `config.local.neon`:

    ```
    $crypt->setPublicKey($myPublicKeyForEncrypt);
    $crypt->setPrivateKey($myPrivateKeyForDecrypt);
    //if there is a private key with a password
    $crypt->setPrivateKeyPassword($myPivateKeyPasswordForDecrypt);
    ```

    or in a `config.local.neon`:

    ```
    crypt:
    	publicKeyPath: publicKeyFile.pub #for encrypting
    	privateKeyPath: privateKeyFile.key #for decrypting
    	privateKeyPassword: 'PrivateKeyPassword' #optional
    ```

    > If you only want to encrypt/decrypt, just define the encrypting/decrypting key
5. And finally?:

    ```
    $encryptedStr = $crypt->encryptRijndaelMessage($stringToEncode); //for transport
    $decryptedStr = $crypt->decryptRijndaelMessage($encryptedStr);

    $encryptedStr = $crypt->encryptRsa($stringToEncode);
    $decryptedStr = $crypt->decryptRsa($encryptedStr);

    $encryptedStr = $crypt->encryptRijndael($stringToEncode);
    $decryptedStr = $crypt->decryptRijndael($encryptedStr);
    ```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

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

Every ~240 days

Total

4

Last Release

1854d ago

Major Versions

v1.0.1 → v2.02020-04-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17454320?v=4)[Milan Sivák](/maintainers/SiViN)[@SiViN](https://github.com/SiViN)

---

Top Contributors

[![SiViN](https://avatars.githubusercontent.com/u/17454320?v=4)](https://github.com/SiViN "SiViN (7 commits)")[![theStormWinter](https://avatars.githubusercontent.com/u/42857353?v=4)](https://github.com/theStormWinter "theStormWinter (1 commits)")

---

Tags

nettesecuritysshblowfishrsaaessftpx509asn1BigIntegertwofishcrypt

### Embed Badge

![Health badge](/badges/sivin-crypt/health.svg)

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

###  Alternatives

[phpseclib/phpseclib

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

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[bordoni/phpass

Portable PHP password hashing framework

244.4M26](/packages/bordoni-phpass)[miladrahimi/phpcrypt

Encryption, decryption, and hashing tools for PHP projects

3171.5k2](/packages/miladrahimi-phpcrypt)

PHPackages © 2026

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