Download the PHP package ifaqih/ifencryption without Composer

On this page you can find all versions of the php package ifaqih/ifencryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ifencryption

IFEncryption

IFEncryption is a simple library that serves to disguise the algorithm method along with options from the password_hash function in php.

PHP Version: 8.0 or above |-

Installation

With Composer:

Use The Library

Configuration

Configuration is useful for setting the default algorithm to be used and its options.

You can set the configuration in the if-encryption.php file in the config directory.

Publish Configuration

In laravel you can also publish configuration file by doing php artisan command

then select IFaqih\IFEncryption\ServiceProvider

Configuration Array Format

Constants

All the constants used by this library.

PHP Default Constants

Existing constants from php:

Constant Name Value Description
PASSWORD_BCRYPT "2y" Use the CRYPT_BLOWFISH algorithm to create the hash
PASSWORD_ARGON2I "argon2i" Use the Argon2i hashing algorithm to create the hash. This algorithm is only available if PHP has been compiled with Argon2 support
PASSWORD_ARGON2ID "argon2id" Use the Argon2id hashing algorithm to create the hash. This algorithm is only available if PHP has been compiled with Argon2 support
PASSWORD_BCRYPT_DEFAULT_COST 10 Default cost set by php
PASSWORD_ARGON2_DEFAULT_MEMORY_COST 65536 Default memory cost set by php
PASSWORD_ARGON2_DEFAULT_TIME_COST 4 Default time cost set by php
PASSWORD_ARGON2_DEFAULT_THREADS 1 Default threads set by php

Constants Added By The Library

Additional constants to support this library:

Constant Name Value Description
DONT_REHASH 1 Rehashing will not be performed
REHASH_FIXED 2 Will perform rehashing based on available hashes
REHASH_CONFIG 4 Will perform rehashing based on the configuration that has been set
REHASH_BCRYPT 8 Will perform rehashing using the CRYPT_BLOWFISH algorithm
REHASH_ARGON2I 16 Will perform rehashing using the Argon2i algorithm
REHASH_ARGON2ID 32 Will perform rehashing using the Argon2id algorithm
REHASH_RAND_ALL_ALGO 64 Will perform the rehashing using one of all randomly selected algorithms
REHASH_DEFAULT_OPTIONS 128 Will do rehashing with default options from php

Class Methods

Set Algorithm

Set of algorithms to be used.

Set Random Algorithm

Which set of algorithms will be used, which will be randomly selected by the library.

Set Default Options

Set to the default options set by php.

Set Options

Set options of algorithms to be used.

Set Time Cost

Set time cost of algorithms to be used.

this class method only applies if you use ARGON2I and ARGON2ID algorithms

Set Memory Cost

Set memory cost of algorithms to be used.

this class method only applies if you use ARGON2I and ARGON2ID algorithms

Set Threads

Set threads of algorithms to be used.

this class method only applies if you use ARGON2I and ARGON2ID algorithms

Set Cost

Set cost of bcrypt to be used.

this class method only applies if you use the BCRYPT algorithm

Execute Hashing

Executes hashing according to predefined algorithms and options.

Verify Hash

Verify string with existing hash.

additional constants are useful as rehash flags in the verify() method

Get New Hash

Get the new hash after verify.

Get Details Hash

Get details of hash data.

Get Algorithm Data

Get the algorithm data used.

Get Option Data

Get the data of the options used.

Example

Example 1:

Example 2:

Example 3:

Example with set_rand_algo() method

Example 4:

Example with config file and set_algo() method

Example 5:

In this example if there is more than one algorithm in the config array, it will be chosen randomly by the library.

Example 6:

In this example the library will only apply the algorithm in the configuration file while the options will be overridden by the default options from php.

Example 7:

Example by using the set_rand_algo() and set_default_options() methods.


All versions of ifencryption with dependencies

PHP Build Version
Package Version
Requires php Version >= 8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ifaqih/ifencryption contains the following files

Loading the files please wait ....