PHPackages                             mmeyer2k/ralph - 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. mmeyer2k/ralph

ActiveLibrary[Security](/categories/security)

mmeyer2k/ralph
==============

A semi-secure symmetric encryption library

16PHP

Since Aug 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mmeyer2k/ralph)[ Packagist](https://packagist.org/packages/mmeyer2k/ralph)[ RSS](/packages/mmeyer2k-ralph/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ralph
=====

[](#ralph)

A semi-secure symmetric encryption library that sometimes eats crayons.

Ralph provides acceptable security in situations where size is critical. All major security parameters are 64 bit (block, iv and checksum). As a result, input strings under 8 bytes long result in a 24 byte cypher text.

```
$encrypted = ralph()::encrypt('secret', 'password');

var_dump(base64_encode($encrypted));
#string(32) "M783Db84XVPukJZkRh05R5ZBZxcD4CvM"

$decrypted = ralph()::decrypt($encrypted, 'password');

var_dump($decrypted);
#string(6) "secret"
```

Ralph isn't very smart, so he registers himself the in global namespace `\Ralph`. He also registers the global helper function `ralph()`, for your convenience and amusement.

install
-------

[](#install)

**EXPERIMENTAL**

Ralph is compatible with PHP versions 7.1 to 8.1.

```
composer require mmeyerk/ralph main-dev
```

how it works
------------

[](#how-it-works)

Ralph uses `hash_pbkdf2()` to generate a key stream which is then XORed with the message. Both `encrypt` and `decrypt` functions accept an optional third parameter to specify iterations for key hardening.

```
$iterations = 10000;
$encrypted = ralph()::encrypt('secret', 'password', $iterations);
$decrypted = ralph()::decrypt($encrypted, 'password', $iterations);
```

specs
-----

[](#specs)

- initialization vector (`random_bytes`)
- time-safe checksum verification (`hash_equals`, `hash_hmac`, `sha3-256`)
- block padding (`PKCS#7`)
- key stream generation (`hash_pbkdf2`, `sha3-512`)

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

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/4c39fe5f8d80dda8a5735401c12cb631d5e17050f7baa7cd3f0f384167fb45db?d=identicon)[mmeyer2k](/maintainers/mmeyer2k)

---

Top Contributors

[![mmeyer2k](https://avatars.githubusercontent.com/u/1887431?v=4)](https://github.com/mmeyer2k "mmeyer2k (25 commits)")

### Embed Badge

![Health badge](/badges/mmeyer2k-ralph/health.svg)

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

###  Alternatives

[phpids/phpids

PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art security layer for your PHP based web application

791150.0k2](/packages/phpids-phpids)[paragonie/ecc

PHP Elliptic Curve Cryptography library

25866.3k44](/packages/paragonie-ecc)[nicobleiler/php-passphrase

Passphrase generator with Laravel integration, inspired by Bitwarden. Uses the EFF long word list by default with support for custom wordlists.

4912.6k](/packages/nicobleiler-php-passphrase)[dwgebler/encryption

Encryption wrapper for PHP using libsodium — simple API for symmetric and asymmetric encryption, password hashing, digital signing, and message authentication.

317.5k](/packages/dwgebler-encryption)

PHPackages © 2026

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