PHPackages                             blackcube/powshield - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. blackcube/powshield

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

blackcube/powshield
===================

Blackcube POW Shield for Yii2

1.0.0(2y ago)0118proprietaryPHP &gt;=8.0

Since Jun 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/blackcubeio/powshield)[ Packagist](https://packagist.org/packages/blackcube/powshield)[ Docs](https://powshield.blackcube.io/)[ RSS](/packages/blackcube-powshield/feed)WikiDiscussions master Synced yesterday

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

PowsShield for Yii2
===================

[](#powsshield-for-yii2)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

```
composer require blackcube/powshield
```

Configuration
-------------

[](#configuration)

Add the following code to your configuration file:

```
return [
    // ...
    'modules' => [
        // ...
        'powshield' => [
            'class' => 'blackcube\powshield\Module',
            'key' => 'your-secret-key',
            'algorithm' => 'SHA-256', // SHA-256, SHA-384, SHA-512
            'minIterations' => 1000, // change iterations to make the process slower
            'maxIterations' => 100000,
            'saltLength' => 12, // change salt length to make the process slower
            'antiReplay' => true, // enable anti-replay mechanism, needs app to have cache component
            'antiReplayTimeout' => 300, // duration of the anti-replay mechanism
            'timeValidity' => 300, // duration of the challenge validity
        ],
    ],
    'bootstrap' => [
        // ...
        'powshield'
    ],
];
```

This sets up the module and:

1. activate api routes:

- `/powshield/generate-challenge` to generate a challenge
- `/powshield/verify-solution` to check a solution

2. activate the validator:

- `powshield` to validate a solution in a model

Usage
-----

[](#usage)

### Client side

[](#client-side)

You can use the following libraries to generate and check the solution:

- @blackcube/aurelia2-powshield [Aurelia 2 powshield](https://www.npmjs.com/package/@blackcube/aurelia2-powshield)
- @blackcube/vanilla-powshield [VanillaJS powshield](https://www.npmjs.com/package/@blackcube/vanilla-powshield)

Once solution is generated, you should send it to the server

### Server side

[](#server-side)

You can use the following code to validate a solution:

```
class MyModel extends yii\base\Model
{
    public $captchaSolution;
    public $name;

    public function rules()
    {
        return [
            [['captchaSolution', 'name'], 'required'],
            ['captchaSolution', 'powshield'],
        ];
    }
}
```

If the solution is not valid, the model will have an error on `captchaSolution`.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

741d ago

### Community

Maintainers

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

---

Tags

captchayii2yiiinvisibleshieldpowblackcube

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/blackcube-powshield/health.svg)

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

###  Alternatives

[brussens/yii2-maintenance-mode

Maintenance mode component for Yii framework 2.x.x version.

78263.0k5](/packages/brussens-yii2-maintenance-mode)

PHPackages © 2026

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