PHPackages                             gremo/email-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. gremo/email-obfuscator

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

gremo/email-obfuscator
======================

A text filter for automatic email obfuscation using Javascript or CSS fallback

v1.0.0(5y ago)91.8k1[1 PRs](https://github.com/gremo/email-obfuscator/pulls)MITPHPPHP &gt;=5.4.0

Since Oct 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/gremo/email-obfuscator)[ Packagist](https://packagist.org/packages/gremo/email-obfuscator)[ Docs](http://github.com/gremo/email-obfuscator)[ RSS](/packages/gremo-email-obfuscator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Email Obfuscator
================

[](#email-obfuscator)

> I'm not the author of this package. The original package was `propaganistas/email-obfuscator` but the author decided to abandon and delete the GitHub repository, **breaking all sites** using it. I've just cloned and uploaded the latest version available.

A text filter for automatic email obfuscation using the well-established JavaScript and a CSS fallback:

- ROT13 ciphering for JavaScript-enabled browsers
- CSS reversed text direction for non-JavaScript browsers

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

[](#installation)

Install the bundle via Composer:

```
composer require gremo/email-obfuscator
```

Then include the supplied JavaScript file (`assets/email-obfuscator.min.js`) somewhere in your template. CND alternative (no uptime guaranteed):

```
https://cdn.rawgit.com/gremo/email-obfuscator/master/assets/email-obfuscator.min.js
```

### Platform specific steps

[](#platform-specific-steps)

- [Standalone](#standalone)
- [Laravel 5](#laravel)
- [Twig](#twig)

#### Standalone

[](#standalone)

Require the `src/Obfuscator.php` file somewhere in your project:

```
require_once 'PATH_TO_LIBRARY/src/Obfuscator.php';
```

Parse and obfuscate a string by using the `obfuscateEmail($string)` function.

#### Laravel 5

[](#laravel-5)

You have 3 options depending on your use case:

- If you want to obfuscate all email addresses that Laravel ever outputs, add the middleare class to the `$middleware` array in `App\Http\Middleware\Kernel.php`:

```
protected $middleware = [
    \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
    // ...
    \Gremo\EmailObfuscator\Laravel\Middleware::class,
];
```

This is the reccomended method.

- If you only want to have specific controller methods return obfuscated email addresses, add the Middleware class to the `$routeMiddleware` array in `App\Http\Middleware\Kernel.php`:

```
protected $routeMiddleware = [
    'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
    // ...
    'obfuscate' => \Gremo\EmailObfuscator\Laravel\Middleware::class,
];
```

... and apply controller middleware as usual in a controller's construct method or route definition:

```
public function __construct()
{
    $this->middleware('obfuscate');
}
```

- If you want to apply obfuscation only on specific strings, just use the `obfuscateEmail($string)` function.

#### Twig

[](#twig)

Add the extension to the `Twig_Environment`:

```
$twig = new Twig_Environment(...);
$twig->addExtension(new \Gremo\EmailObfuscator\Twig\Extension());
```

The extension exposes an `obfuscateEmail` Twig filter, which can be applied to any string.

```
{{ "Lorem Ipsum"|obfuscateEmail }}
{{ variable|obfuscateEmail }}
```

Credits
-------

[](#credits)

- [Scott Yang](http://scott.yang.id.au/2003/06/obfuscate-email-address-with-JavaScript-rot13) for the JavaScript used in this method.
- [Silvan Mühlemann](http://techblog.tilllate.com/2008/07/20/ten-methods-to-obfuscate-e-mail-addresses-compared/) for the inspiration of the CSS implementation.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

2043d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9a79689fe41827b4fd386dd42a9117115e27a4f946935d6ce77d7f6a76260fe?d=identicon)[gremo](/maintainers/gremo)

---

Top Contributors

[![gremo](https://avatars.githubusercontent.com/u/1532616?v=4)](https://github.com/gremo "gremo (1 commits)")

---

Tags

laraveltwigemailspamantispamobfuscation

### Embed Badge

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

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

###  Alternatives

[twig/inky-extra

A Twig extension for the inky email templating engine

16612.5M47](/packages/twig-inky-extra)[nucleos/antispam-bundle

This bundle provides some basic features to reduce spam in symfony forms.

52105.1k](/packages/nucleos-antispam-bundle)[hedronium/spaceless-blade

Adds the @spaceless tag to Blade. (works like in Twig)

32632.8k1](/packages/hedronium-spaceless-blade)

PHPackages © 2026

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