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

ActiveLibrary

gabbro-php/crypt
================

Encryption and Hash library

1.006466(7mo ago)00MITPHPPHP &gt;=8.0.0

Since Sep 27Pushed 7mo agoCompare

[ Source](https://github.com/gabbro-php/crypt)[ Packagist](https://packagist.org/packages/gabbro-php/crypt)[ RSS](/packages/gabbro-php-crypt/feed)WikiDiscussions gh-main Synced 1mo ago

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

Gabbro - Cryptography Utility Library
=====================================

[](#gabbro---cryptography-utility-library)

This library provides a unified abstraction layer for **message digests** and **symmetric ciphers**, built around two core interfaces:

- `Digest` — for hashing, HMACs, verification, and key derivation.
- `Cipher` — for symmetric encryption and decryption.

It includes implementations backed by both PHP’s native extensions (`hash`, OpenSSL) and libsodium, so you can pick the provider that best fits your environment.

---

✨ Features
----------

[](#-features)

### Digest

[](#digest)

- Unified interface for:
    - Hashing arbitrary data
    - Creating and verifying MACs
    - Deriving keys from global secrets + salt
- Configurable “levels” for computational cost:
    - **Fast** (low iterations)
    - **Moderate** (default for most apps)
    - **Sensitive** (high security, slow, suitable for offline tasks)
- Implementations:
    - **HashDigest**: Uses PHP’s `hash_*` and `hash_pbkdf2`
    - **SodiumDigest**: Uses libsodium’s `crypto_pwhash`, `crypto_generichash`, and `crypto_auth`

### Cipher

[](#cipher)

- Unified interface for symmetric encryption/decryption
- Implementations:
    - **SSLCipher**: Wraps OpenSSL, supporting AES, Camellia, Aria, and many other algorithms/modes.
    - **SodiumCipher**: Wraps libsodium’s `crypto_secretbox`, providing authenticated encryption (confidentiality + integrity in one step).
- Automatic key and IV/nonce management, with helpers for generation and normalization.

---

🔑 Security Model
----------------

[](#-security-model)

- **OpenSSL ciphers**: require explicit IVs and may require separate HMACs for authenticity (unless using AEAD modes like GCM).
- **Sodium ciphers**: always use authenticated encryption (via XSalsa20 + Poly1305). Any tampering with ciphertext is detected during decryption.

This library ensures correct handling of secrets, salts, IVs, and nonces to reduce cryptographic misuse.

---

📦 Requirements
--------------

[](#-requirements)

- OpenSSL extension (for `SSLCipher`)
- Libsodium extension (for `SodiumCipher` / `SodiumDigest`)

---

🔐 Philosophy
------------

[](#-philosophy)

The main goal is to make crypto **easy to use correctly**:

- Configure once (secret, salt, key size, cipher mode).
- Use everywhere without boilerplate.
- Provide safe defaults and abstract away low-level details.

---

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance62

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

233d ago

### Community

Maintainers

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

---

Top Contributors

[![dbergloev](https://avatars.githubusercontent.com/u/1395583?v=4)](https://github.com/dbergloev "dbergloev (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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