2017 © Pedro Peláez
 

library cws-crypto

PHP class for password hashing with multi encryption methods.

image

crazy-max/cws-crypto

PHP class for password hashing with multi encryption methods.

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 10 Versions
  • 9 % Grown

The README.md

Latest Stable Version Minimum PHP Version Build Status Code Quality Become a sponsor Donate Paypal, (*1)

:warning: Abandoned project

This project is not maintained anymore and is abandoned. Feel free to fork and make your own changes if needed., (*2)

Thanks to everyone for their valuable feedback and contributions., (*3)

About

PHP class for password hashing with multi encryption methods., (*4)

Overview

The PBKDF2 key derivation function

Defined by RSA's PKCS #5: https://www.ietf.org/rfc/rfc2898.txt
This implementation of PBKDF2 was originally created by https://defuse.ca/php-pbkdf2.htm
With improvements by http://www.variations-of-shadow.com, (*5)

The OpenBSD-style Blowfish-based bcrypt

This hashing method is known in PHP as CRYPT_BLOWFISH.
More infos : http://www.php.net/security/crypt_blowfish.php
This implementation of BCRYPT was originally created by http://www.openwall.com/phpass/, (*6)

Generate random bytes

A random() function is available to generate secure random bytes with 5 methods : * mcrypt_create_iv * openssl_random_pseudo_bytes * GetRandom function from CAPICOM Microsoft class * /dev/urandom on Unix systems * Mix of microtime and getmypid functions, (*7)

Encrypt/Decrypt datas

There is also a method to encrypt/decrypt data using a symectric encryption string with the blowfish algorithm and an encryption key in CFB mode but please be advised that you should not use this method for truly sensitive data., (*8)

Installation

composer require crazy-max/cws-crypto

And download the code:, (*9)

composer install # or update

Getting started

See tests/test.php file sample to help you., (*10)

Example

, (*11)

Methods

hashPassword - Create a password hash.
checkPassword - Check a hash with the password given.
encrypt - Generate a symectric encryption string with the blowfish algorithm and an encryption key in CFB mode.
decrypt - Return the decrypted string generated from the encrypt method.
random - Generate secure random bytes with 5 methods : mcrypt_create_iv, openssl_random_pseudo_bytes, GetRandom() from CAPICOM Microsoft class, /dev/urandom on Unix systems or mt_rand() and getmypid() functions.
, (*12)

setPbkdf2Mode - Set the pbkdf2 mode for hashing/check password.
setBcryptMode - Set the bcrypt mode for hashing/check password. (default)
setEncryptionKey - Set the encryption key for encrypt/decrypt method (max length 56).
getError - Get the last error.
, (*13)

How can I help ?

All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by becoming a sponsor on GitHub :clap: or by making a Paypal donation to ensure this journey continues indefinitely! :rocket:, (*14)

Thanks again for your support, it is much appreciated! :pray:, (*15)

License

MIT. See LICENSE for more details., (*16)

The Versions

07/06 2018

dev-master

9999999-dev https://github.com/crazy-max/CwsCrypto

PHP class for password hashing with multi encryption methods.

  Sources   Download

MIT LGPL

The Requires

 

password blowfish crypto pbkdf2 bcrypt

30/04 2018

1.0

1.0.0.0

  Sources   Download

30/04 2018

1.1

1.1.0.0

  Sources   Download

30/04 2018

1.2

1.2.0.0

  Sources   Download

30/04 2018

1.3

1.3.0.0

  Sources   Download

30/04 2018

1.4

1.4.0.0

  Sources   Download

30/04 2018

1.5

1.5.0.0

  Sources   Download

04/01 2018

1.8

1.8.0.0 https://github.com/crazy-max/CwsCrypto

PHP class for password hashing with two different encryption methods.

  Sources   Download

MIT

The Requires

 

password blowfish crypto pbkdf2 bcrypt

28/11 2016

1.7

1.7.0.0 https://github.com/crazy-max/CwsCrypto

PHP class for password hashing with two different encryption methods.

  Sources   Download

LGPL

The Requires

 

password blowfish crypto pbkdf2 bcrypt

22/08 2016

1.6

1.6.0.0 https://github.com/crazy-max/CwsCrypto

PHP class for password hashing with two different encryption methods.

  Sources   Download

LGPL

The Requires

 

password blowfish crypto pbkdf2 bcrypt