PHPackages                             alexandernst/yii2-scrypt - 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. [Security](/categories/security)
4. /
5. alexandernst/yii2-scrypt

ActiveYii2-extension[Security](/categories/security)

alexandernst/yii2-scrypt
========================

Scrypt key derivation function for Yii2

0.0.4(11y ago)177GNU General Public License v3PHP

Since Apr 4Pushed 11y ago1 watchersCompare

[ Source](https://github.com/alexandernst/yii2-scrypt)[ Packagist](https://packagist.org/packages/alexandernst/yii2-scrypt)[ RSS](/packages/alexandernst-yii2-scrypt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

yii2-scrypt
===========

[](#yii2-scrypt)

Scrypt key derivation function for Yii2

To use it just require this extension in your composer.json file:

```
"alexandernst/yii2-scrypt": "0.0.4",

```

And then add it to your components configuration in Yii2:

```
'components' => [
	'Scrypt' => [
		'class' => 'alexandernst\Scrypt\Scrypt'
	],
]
```

To derivate a key, use the following method:

```
/**
* Scrypt algorithm
*
* @param  string $password
* @param  string $salt
* @param  int $n CPU/Memory cost parameter, must be larger than 1, a power of 2 and less than 2^(128 * r / 8)
* @param  int $r Block size
* @param  int $p Parallelization parameter, a positive integer less than or equal to ((2^32-1) * hLen) / MFLen where hLen is 32 and MFlen is 128 * r
* @param  int $length Length of the output key
* @throws Exception
* @return string
*/
echo bin2hex(\Yii::$app->Scrypt->calc("plain password", "salt", 8, 8, 16, 32));
```

This class passes all the tests specified [in the documentation](https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Every ~0 days

Total

4

Last Release

4062d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/617ea779011249f99b5d6486b33df7bf1ae2e2121f76354a0ad6e1c4fb076dc6?d=identicon)[alexandernst](/maintainers/alexandernst)

---

Top Contributors

[![alexandernst](https://avatars.githubusercontent.com/u/89727?v=4)](https://github.com/alexandernst "alexandernst (8 commits)")

---

Tags

encryptionyii2extensionhmacpbkdf2scryptsalsa208key derivation

### Embed Badge

![Health badge](/badges/alexandernst-yii2-scrypt/health.svg)

```
[![Health](https://phpackages.com/badges/alexandernst-yii2-scrypt/health.svg)](https://phpackages.com/packages/alexandernst-yii2-scrypt)
```

###  Alternatives

[nickcv/yii2-encrypter

Openssl Encrypter for Yii2

19640.0k1](/packages/nickcv-yii2-encrypter)[hyperia/yii2-secure-headers

Secure headers for your Yii2 app

21189.5k](/packages/hyperia-yii2-secure-headers)[juliardi/yii2-captcha

Captcha library wrapper for Yii2

167.9k](/packages/juliardi-yii2-captcha)

PHPackages © 2026

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