PHPackages                             devjack/encrypted-content-encoding - 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. devjack/encrypted-content-encoding

ActiveLibrary[Security](/categories/security)

devjack/encrypted-content-encoding
==================================

Encrypted Content-Encoding for HTTP (RFC8188)

v0.3.0(7y ago)44.1k↓33.6%MITPHPPHP ~5.6 || &gt;=7.1

Since Oct 28Pushed 7y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (7)Used By (0)

Encrypted Content-Encoding
==========================

[](#encrypted-content-encoding)

Introduction
------------

[](#introduction)

> PHP implementation of RFC8188 to encrypt HTTP messages.

[![Build Status](https://camo.githubusercontent.com/73a782495045bcabbc4b578f4d09a696fcf97a17d3bb73be8114d46d2654d5a9/68747470733a2f2f7472617669732d63692e6f72672f6465766a61636b2f656e637279707465642d636f6e74656e742d656e636f64696e672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/devjack/encrypted-content-encoding)[![Latest Stable Version](https://camo.githubusercontent.com/85156ffdafc2d0ef3574af0f65f03a46034c36f23699029b12a71b399543aa56/68747470733a2f2f706f7365722e707567782e6f72672f6465766a61636b2f656e637279707465642d636f6e74656e742d656e636f64696e672f762f737461626c65)](https://packagist.org/packages/devjack/encrypted-content-encoding)[![Total Downloads](https://camo.githubusercontent.com/fc391496f19d039b50461ef1dfd1c26f61ebcda049b3d08260e1b334c820aca9/68747470733a2f2f706f7365722e707567782e6f72672f6465766a61636b2f656e637279707465642d636f6e74656e742d656e636f64696e672f646f776e6c6f616473)](https://packagist.org/packages/devjack/encrypted-content-encoding)[![Latest Unstable Version](https://camo.githubusercontent.com/0fa609c97e2a4639386dfa91aa6a36b8b4cdf996cf77634a39bb502d05aa9fdf/68747470733a2f2f706f7365722e707567782e6f72672f6465766a61636b2f656e637279707465642d636f6e74656e742d656e636f64696e672f762f756e737461626c65)](https://packagist.org/packages/devjack/encrypted-content-encoding)[![License](https://camo.githubusercontent.com/a0b26f77b20742b415ea3d8a1b18a8159ab06e9cfdd72475b6200857b9165510/68747470733a2f2f706f7365722e707567782e6f72672f6465766a61636b2f656e637279707465642d636f6e74656e742d656e636f64696e672f6c6963656e7365)](https://packagist.org/packages/devjack/encrypted-content-encoding)

Code Samples
------------

[](#code-samples)

> Note: RFC8188 relies heavily on base64 URL encoding.

### Simple callback function for encryption key lookup

[](#simple-callback-function-for-encryption-key-lookup)

```
require_once "vendor/autoload.php";

use Base64Url\Base64Url as b64;

$message = "I am the walrus";

$encoded = RFC8188::rfc8188_encode(
    $message, // plaintext
    b64::decode("yqdlZ-tYemfogSmv7Ws5PQ"), // encryption key
    null,   // key ID
    123    // record size.
);
$decoded = RFC8188::rfc8188_decode(
    $encoded, // data to decode
    function($keyid) { return b64::decode('yqdlZ-tYemfogSmv7Ws5PQ'); }
);

$this->assertEquals($message, $decoded);
```

### Invocable class for key lookup

[](#invocable-class-for-key-lookup)

In this example we use a simple incovable class to provide key lookup. This may be more useful in complex framework integrations such as providing middleware that looks up keys from a database. This sample does not cover service injection to the key lookup class.

```
use DevJack\EncryptedContentEncoding\RFC8188;
use DevJack\EncryptedContentEncoding\Exception\EncryptionKeyNotFound;
use Base64Url\Base64Url as b64;

class MockKeyLookupProvider {

    protected $keys = [];

    public function addKey($key, $keyid='') {
        $this->keys[$keyid] = $key;
    }
    public function __invoke($keyid) {
        if (in_array($keyid, array_keys($this->keys))) {
            return $this->keys[$keyid];
        }
        throw new EncryptionKeyNotFound("Encryption key not found.");
    }
}

$encoded = b64::decode("uNCkWiNYzKTnBN9ji3-qWAAAABkCYTHOG8chz_gnvgOqdGYovxyjuqRyJFjEDyoF1Fvkj6hQPdPHI51OEUKEpgz3SsLWIqS_uA");

$keyProvider = new MockKeyLookupProvider();
$keyProvider->addKey(b64::decode("BO3ZVPxUlnLORbVGMpbT1Q"), 'a1');

$decoded = RFC8188::rfc8188_decode(
    $encoded, // data to decode
    $keyProvider
);
```

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

[](#installation)

Available via composer.

```
composer require devjack/encrypted-content-encoding

```

### PHP 5.6 compatibility

[](#php-56-compatibility)

Additionally, install a polyfill for random\_bytes such as:

```
composer require paragonie/random_compat

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~20 days

Total

5

Last Release

2680d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30285977?v=4)[developerjack](/maintainers/developerjack)[@developerjack](https://github.com/developerjack)

---

Top Contributors

[![devjack](https://avatars.githubusercontent.com/u/3516066?v=4)](https://github.com/devjack "devjack (30 commits)")

---

Tags

encodingencryptionhttpmiddlewarephprfc8188middlewareencryptionencodingrfc8188aes128gcm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devjack-encrypted-content-encoding/health.svg)

```
[![Health](https://phpackages.com/badges/devjack-encrypted-content-encoding/health.svg)](https://phpackages.com/packages/devjack-encrypted-content-encoding)
```

###  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)[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[paragonie/ciphersweet

Searchable field-level encryption library for relational databases

4641.2M21](/packages/paragonie-ciphersweet)[ass/xmlsecurity

The XmlSecurity library is written in PHP for working with XML Encryption and Signatures

955.6M30](/packages/ass-xmlsecurity)[pear/crypt_gpg

Provides an object oriented interface to the GNU Privacy Guard (GnuPG). It requires the GnuPG executable to be on the system.

954.4M10](/packages/pear-crypt-gpg)[nzo/url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

961.0M2](/packages/nzo-url-encryptor-bundle)

PHPackages © 2026

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