2017 © Pedro Peláez
 

library secure-functions

Secure-functions makes it easier to secure functionality

image

crecket/secure-functions

Secure-functions makes it easier to secure functionality

  • Friday, April 8, 2016
  • by Crecket
  • Repository
  • 1 Watchers
  • 2 Stars
  • 141 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

secure-functions

Latest Stable Version Build Status, (*1)

A collection of functions which can be used for security purposes., (*2)

Instalation

Composer

Install through composer and require the autoloader., (*3)

composer require crecket/secure-functions, (*4)

Manual

Download the files and require them in your project., (*5)

require '/secure-functions/src/SecureFuncs.php';, (*6)

Scrypt and Encryption

domBlack/php-scrypt

Install the php module if you want to use scrypt hashing, (*7)

Usage

All functions are static public functions right now so you can simply call the functions like this:, (*8)

SecureFuncs\SecureFuncs::password_hash('input');, (*9)

Functions

compareStrings($string1, $string2)

Compare strings while preventing timed attacks, (*10)

getFormToken('form_token_id', $form_token, $limit = 300)

Verify a form token for the given id. The $limit is optional andm ust be given in seconds, if the limit is 300 and the token is used after 300 seconds it will be considered invalid., (*11)

password_hash($password)

Hash the given password. This function allows for longer passwords and isn't affected by the null-byte issue., (*12)

password_verify($password, $hash)

Verify the given password hash, (*13)

randomHex($length)

Returns a random hexadecimal number for the given length, (*14)

randomInt($min, $max)

Returns the a secure random integer within the given range., (*15)

randomString($length)

Returns a random string for the given length, (*16)

scryptcheck($password, $hash)

Compare a password and hash using DomBlack/php-scrypt, (*17)

scrypthash($password, $salt, $cpu, $memory, $parallel)

Hash a password using DomBlack's php scrypt library, (*18)

setFormToken($id)

Set a unique token in the session and returns it, can be used to verify post/get requests, (*19)

strlen($str)

Returns the length of the given string using mb_strlen when available, (*20)

pseudoBytes($length)

Returns random bytes for the given length, (*21)

The Versions

08/04 2016

dev-master

9999999-dev

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

  • php >=5.6.0

 

by Gregory Goijaerts

08/04 2016

1.4

1.4.0.0

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

  • php >=5.6.0

 

by Gregory Goijaerts

27/03 2016

1.3

1.3.0.0

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

 

by Gregory Goijaerts

14/03 2016

1.2.1

1.2.1.0

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

 

by Gregory Goijaerts

14/03 2016

1.2

1.2.0.0

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

 

by Gregory Goijaerts

17/01 2016

1.1.2

1.1.2.0

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

 

by Gregory Goijaerts

11/01 2016

1.1.1

1.1.1.0

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

 

by Gregory Goijaerts

10/01 2016

1.1

1.1.0.0

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

 

by Gregory Goijaerts

28/12 2015

1.0.0

1.0.0.0

Secure-functions makes it easier to secure functionality

  Sources   Download

WTFPL

The Requires

 

by Gregory Goijaerts