PHPackages                             geggleto/securejwt - 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. geggleto/securejwt

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

geggleto/securejwt
==================

Secure JWT

0.0.1(10y ago)423[1 issues](https://github.com/geggleto/securejwt/issues)MITPHP

Since May 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/geggleto/securejwt)[ Packagist](https://packagist.org/packages/geggleto/securejwt)[ RSS](/packages/geggleto-securejwt/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Encrypt your JSON Web Tokens
============================

[](#encrypt-your-json-web-tokens)

Pre-Req
-------

[](#pre-req)

Libsodium is installed and configured in your environment. Our friends over at ParagonIE have a wonderful document to help you out. [Read it here](https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsodium).

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

[](#installation)

```
composer require geggleto/securejwt
```

Usage
-----

[](#usage)

1. Generate a security key \[a script has been provided scripts/generateSecretKey.php\]
2. Encrypting your Tokens

```
    $config = new \Lcobucci\JWT\Builder(); // This object helps to simplify the creation of the dependencies
    // instead of using "?:" on constructors.

    $token = $config->setIssuer('http://example.com') // Configures the issuer (iss claim)
        ->setAudience('http://example.org') // Configures the audience (aud claim)
        ->setId('4f1g23a12aa', true) // Configures the id (jti claim), replicating as a header item
        ->setIssuedAt(time()) // Configures the time that the token was issue (iat claim)
        ->setNotBefore(time() + 60) // Configures the time that the token can be used (nbf claim)
        ->setExpiration(time() + 3600) // Configures the expiration time of the token (exp claim)
        ->set('uid', 1) // Configures a new claim, called "uid"
        ->getToken(); // Retrieves the generated token

    $secureJwt = new \SecureJwt\SecureJwt('./sec/encryption.key');

    $securedToken = $secureJwt->encryptToken((string)$token); //decryptToken($securedToken);

    $newToken = (new \Lcobucci\JWT\Parser())->parse($tokenString);
```

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

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

3725d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f941aecd52e3f8ac94dbe9b714801c7adc767acc32644d3ee6a4efeded84c5e?d=identicon)[geggleto](/maintainers/geggleto)

---

Top Contributors

[![geggleto](https://avatars.githubusercontent.com/u/4027602?v=4)](https://github.com/geggleto "geggleto (5 commits)")[![matthewtrask](https://avatars.githubusercontent.com/u/4731244?v=4)](https://github.com/matthewtrask "matthewtrask (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/geggleto-securejwt/health.svg)

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

###  Alternatives

[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

84511.6M67](/packages/php-open-source-saver-jwt-auth)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

589701.7k2](/packages/scheb-2fa)[scheb/2fa-trusted-device

Extends scheb/2fa-bundle with trusted devices support

366.0M40](/packages/scheb-2fa-trusted-device)[workos/workos-php

WorkOS PHP Library

423.1M11](/packages/workos-workos-php)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M656](/packages/shopware-core)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

62473.7k9](/packages/jeremy379-laravel-openid-connect)

PHPackages © 2026

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