PHPackages                             jdz/obfuscator - 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. [Templating &amp; Views](/categories/templating)
4. /
5. jdz/obfuscator

ActiveLibrary[Templating &amp; Views](/categories/templating)

jdz/obfuscator
==============

Server-side email obfuscation paired with the jizy-obfuscator JS client

1.0.0(3mo ago)031MITPHPPHP &gt;=8.2

Since Apr 20Pushed 3mo agoCompare

[ Source](https://github.com/joffreydemetz/obfuscator)[ Packagist](https://packagist.org/packages/jdz/obfuscator)[ Docs](https://jdz.joffreydemetz.com/obfuscator)[ RSS](/packages/jdz-obfuscator/feed)WikiDiscussions master Synced 3w ago

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

jdz/emailobfuscator
===================

[](#jdzemailobfuscator)

Server-side email obfuscation paired with the [jizy-obfuscator](https://github.com/joffreydemetz/jizy-obfuscator) JS client.

Emits indexed `` placeholders and ROT13-encoded HTML payloads; the JS client reveals the real markup in the DOM on page load.

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

[](#installation)

```
composer require jdz/emailobfuscator
```

Usage
-----

[](#usage)

### PHP

[](#php)

```
use JDZ\Obfuscator\Obfuscator;

$obfuscator = new Obfuscator();

echo $obfuscator->obfuscate('joe@example.com');
//

echo $obfuscator->obfuscate('support@example.com', 'Write to support', ['class' => 'email']);
//

echo $obfuscator->renderScript();
// window.Obfuscator.decode(["...","..."]);
```

### Twig

[](#twig)

```
use JDZ\Obfuscator\Extension\EmailObfuscatorTwigExtension;

$twig->addExtension(new EmailObfuscatorTwigExtension($obfuscator));
```

```
{{ 'joe@example.com'|obfuscate }}
{{ 'joe@example.com'|obfuscate({ class: 'email' }) }}
{{ obfuscate_email('joe@example.com', 'Write to Joe', { class: 'email' }) }}
{{ obfuscate_html('Hidden') }}

{# near  #}
{{ obfuscate_script() }}
```

API
---

[](#api)

### `Obfuscator`

[](#obfuscator)

MethodReturns`obfuscate(string $email, ?string $label = null, array $attrs = [])`placeholder ```obfuscateHtml(string $html)`placeholder ```getPayloads(): string[]`ROT13-encoded payloads, ordered by index`renderScript(): string``window.Obfuscator.decode([...])` — empty when nothing registered`reset(): void`clears collected payloads### Twig extension

[](#twig-extension)

- Filter `obfuscate(attrs = {})`
- Function `obfuscate_email(email, label = null, attrs = {})`
- Function `obfuscate_html(html)`
- Function `obfuscate_script()`

All filter/function outputs are marked `is_safe: html`.

Client-side
-----------

[](#client-side)

Install and load [jizy-obfuscator](https://www.npmjs.com/package/jizy-obfuscator). Placeholder ids (`#obfuscated-0`, `#obfuscated-1`, ...) match the order of the payloads array passed to `Obfuscator.decode`, which is exactly the order returned by `getPayloads()` here.

Testing
-------

[](#testing)

```
composer install
composer test
```

License
-------

[](#license)

MIT - see [LICENSE](LICENSE)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance82

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

95d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e83e3701566e43438525ed14578487e732b849d152b5071aa1613a0dad96913?d=identicon)[jdz](/maintainers/jdz)

---

Top Contributors

[![joffreydemetz](https://avatars.githubusercontent.com/u/15113527?v=4)](https://github.com/joffreydemetz "joffreydemetz (2 commits)")

---

Tags

twigemailobfuscatorJDZ

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jdz-obfuscator/health.svg)

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

###  Alternatives

[symfony/ux-twig-component

Twig components for Symfony

22018.6M379](/packages/symfony-ux-twig-component)[twig/inky-extra

A Twig extension for the inky email templating engine

16613.6M81](/packages/twig-inky-extra)[symfony/ux-live-component

Live components for Symfony

1647.0M136](/packages/symfony-ux-live-component)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

16126.1k1](/packages/symfony-ux-toolkit)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

262.6k](/packages/mati365-ckeditor5-symfony)

PHPackages © 2026

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