PHPackages                             derrickleemy/jwe-decoder - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. derrickleemy/jwe-decoder

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

derrickleemy/jwe-decoder
========================

An simple JSON Web Token library for PHP.

v1.0.0(6y ago)1680BSD-3-ClausePHPPHP &gt;=5.4.0CI failing

Since Mar 19Pushed 6y agoCompare

[ Source](https://github.com/derrickleemy/jwe-decoder)[ Packagist](https://packagist.org/packages/derrickleemy/jwe-decoder)[ Docs](https://github.com/derrickleemy/jwe-decoder)[ RSS](/packages/derrickleemy-jwe-decoder/feed)WikiDiscussions master Synced 2d ago

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

JWEDecoder
==========

[](#jwedecoder)

JWEDecoder is a lightweight encrypted JWT decoder library written in PHP. It was originally written by Kevin Mo (all credits goes to him), and dialed down for a very specific use case for internal use.

Features
--------

[](#features)

- JSON web encryption [RFC7516](http://tools.ietf.org/html/rfc7516)
- Supported Algorithms
    - RSAES with OAEP (RSA-OAEP-256)

Requirements
------------

[](#requirements)

- PHP 5.4.0 or later
- `hash` extension
- `openssl` extension

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

[](#installation)

You can install via [Composer](http://getcomposer.org/).

```
composer require derrickleemy/jwe-decoder

```

```
{
    "require": {
        "derrickleemy/jwe-decoder": "1.0.*"
    }
}
```

Usage
-----

[](#usage)

### Private Key

[](#private-key)

Private key is required to decode the JWE token. You can add your key by doing the following:

```
$key = file_get_contents('private.pem');
```

### Decrypting a JWE

[](#decrypting-a-jwe)

To decrypt a JWE, use the decrypt function:

```
try {
    $jwt = \JWEDecoder\JWE::decrypt('abc.def.ghi.klm.nop', $key);
} catch (\JWEDecoder\InvalidTokenException $e) {
    dd($e->getMessage());
}

print $jwt->getHeader('alg');
print $jwt->getPlaintext();
print $jwt->getRtHash();
print $jwt->getNonce();
print $jwt->getAmr();
print $jwt->getIat();
print $jwt->getIss();
print $jwt->getSub();
print $jwt->getAtHash();
print $jwt->getExp();
print $jwt->getAud();
```

Authors
-------

[](#authors)

- [Derrick Lee](https://github.com/derrickleemy)
- [Kelvin Mo](https://github.com/kelvinmo)

Credits
-------

[](#credits)

- **derrickleemy** [derrickleemy/jwe-decoder](https://github.com/derrickleemy/jwe-decoder)
- **kevinmo** [kelvinmo/simplejwt](https://github.com/kelvinmo/simplejwt)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

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

Unknown

Total

1

Last Release

2297d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/04032fc0bc8dac86707694b0bed942d9d949cf65afa92f032ee7168db1715f91?d=identicon)[derrickleemy](/maintainers/derrickleemy)

---

Top Contributors

[![derrickleemy](https://avatars.githubusercontent.com/u/28346075?v=4)](https://github.com/derrickleemy "derrickleemy (3 commits)")

---

Tags

jwtJWEJOSE

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/derrickleemy-jwe-decoder/health.svg)

```
[![Health](https://phpackages.com/badges/derrickleemy-jwe-decoder/health.svg)](https://phpackages.com/packages/derrickleemy-jwe-decoder)
```

###  Alternatives

[web-token/jwt-framework

JSON Object Signing and Encryption library for PHP and Symfony Bundle.

95220.7M103](/packages/web-token-jwt-framework)[web-token/jwt-library

JWT library

2015.5M132](/packages/web-token-jwt-library)[kelvinmo/simplejwt

A simple JSON Web Token library for PHP.

701.3M18](/packages/kelvinmo-simplejwt)[web-token/jwt-bundle

JWT Bundle of the JWT Framework.

132.7M8](/packages/web-token-jwt-bundle)[sop/jwx

A PHP library for JSON web tokens (JWT) with signature (JWS) and encryption (JWE) support.

26287.3k1](/packages/sop-jwx)

PHPackages © 2026

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