Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A PHP security library.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 tests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 CHANGELOG.md
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 composer.json
Octocat-spinner-32 phpunit.xml.dist
README.md

phpSec - PHP security library

  • phpSec is a open-source PHP security library that takes care of the common security tasks a web developer faces.

Build Status

Official Website and Documentation

Features

  • Data encryption
  • XSS filter
  • Password hashing
  • Secure session handler
  • CSRF protection
  • Yubikey integration
  • Authy integration
  • Random data generator

Installing

phpSec is now a PSR-0 compatible library. this means that it can easilly be installed and loaded using Composer. You can also install phpSec manually, or using Git.

Installing using Composer

To install using Composer just add phpSec to your composer.json file in your project directory.

{
    "require": {
        "phpsec/phpsec":"0.6.*"
    }
}

Then all you need to do is to run $ php composer.phar install . phpSec can then be loaded using the Composer autoloader.

require 'vendor/autoload.php';

Installing manually/Git

Download, checkout or peferrably add phpSec as a Git submodule. Then load the lib/phpSec/bootstrap.php file. This is a really simple autoloader that will load phpSec classes when needed.

require_once 'lib/phpSec/bootstrap.php';

If you already have a PSR-0 compatible autoloader for your project there is no need to call the bootstrap.php file. All you have to do is to register the phpSec namespace to the phpSec/lib folder.

If you want to add an autoloader to your project there is one example here. This can be initialized like this:

<?php
require_once 'SplClassLoader.php';
$classLoader = new SplClassLoader('phpSec', '/var/www/vendor/phpSec/lib');
$classLoader->register();

For documentation on how to use the various phpSec functionality, take alook at the phpsec/doc repository.

System requirements

  • PHP >= 5.3.7
  • Mcrypt, if you want to encrypt stuff.

Getting help / Contact

License

phpSec is open-sourced software licensed under the MIT License.

Something went wrong with that request. Please try again.