PHPackages                             nice/security - 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. nice/security

ActiveLibrary[Security](/categories/security)

nice/security
=============

Simple security component for Nice applications

1.0.0(11y ago)13.5k↓100%1MITPHPPHP &gt;=5.4.0

Since Dec 11Pushed 11y ago2 watchersCompare

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

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

security
========

[](#security)

Simple security component for Nice applications.

[View the full documentation online](http://niceframework.com/nice/latest/extensions/security).

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

[](#installation)

Install the nice/security package using [Composer](http://getcomposer.org).

From your project root directory, run:

```
composer require nice/security:1.0.x-dev

```

This command will add nice/security package to your `composer.json` and then install the necessary files.

Usage
-----

[](#usage)

nice/security includes a default authenticator, `Nice\Security\Authenticator\SimpleAuthenticator`. This authenticator uses the PHP 5.5 [password\_\*](http://php.net/password) API, falling back to ircmaxell's [password\_compat](https://github.com/ircmaxell/password_compat) library on PHP 5.4.

You must hash your password prior to using nice/security. This can be done through the included `hashpass.php`utility.

Full source code to `hashpass.php`:

```
