承接 crecket/secure-functions 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

crecket/secure-functions

Composer 安装命令:

composer require crecket/secure-functions

包简介

Secure-functions makes it easier to secure functionality

README 文档

README

Latest Stable Version Build Status

A collection of functions which can be used for security purposes.

Instalation

Composer

Install through composer and require the autoloader.

composer require crecket/secure-functions

Manual

Download the files and require them in your project.

require '/secure-functions/src/SecureFuncs.php';

Scrypt and Encryption

domBlack/php-scrypt

Install the php module if you want to use scrypt hashing

Usage

All functions are static public functions right now so you can simply call the functions like this:

SecureFuncs\SecureFuncs::password_hash('input');

Functions

compareStrings($string1, $string2)

Compare strings while preventing timed attacks

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.

password_hash($password)

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

password_verify($password, $hash)

Verify the given password hash

randomHex($length)

Returns a random hexadecimal number for the given length

randomInt($min, $max)

Returns the a secure random integer within the given range.

randomString($length)

Returns a random string for the given length

scryptcheck($password, $hash)

Compare a password and hash using DomBlack/php-scrypt

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

Hash a password using DomBlack's php scrypt library

setFormToken($id)

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

strlen($str)

Returns the length of the given string using mb_strlen when available

pseudoBytes($length)

Returns random bytes for the given length

统计信息

  • 总下载量: 156
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: WTFPL
  • 更新时间: 2015-12-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固