PHP Classes

Yet Another Hash Package: Generate a hash of a string using text scrambling

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 91 All time: 9,939 This week: 673Up
Version License PHP version Categories
yahp 1.0.0Custom (specified...5.3PHP 5, Cryptography, Text processing
Description 

Author

This class can generate a hash of a string using text scrambling.

It combines regular hashing algorithms with combined with text scrambling and character shuffling to generate different output of the usual hashing algorithms.

A cost number parameter can make the class use additional passes of hashing algorithms.

Picture of zinsou A.A.E.Moïse
  Performance   Level  
Name: zinsou A.A.E.Moïse <contact>
Classes: 50 packages by
Country: Benin Benin
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

Example

<?php
require_once('./Ezama_Hashmore.php');
$x=new \eZama\Hashmore(new Hashids\Hashids());

echo
'<pre>';
$ti=microtime();
$start = microtime(true);

var_dump(
$e=$x->secretstr('leizmo@gmail.com','another string here',10,$ti)

);
$end = microtime(true);
 
var_dump(
$f=$x->secretstr('leizmo@gmail.com','',10,$ti)
 );

var_dump($f==$e);

 
var_dump(
$f=$x->secretstr('leizmo@gmail.com','another string here',11,$ti)
 );
 
var_dump($f==$e);
 
var_dump(
$f=$x->secretstr('leizmo@gmail.com','another string here',10,$ti)
);
 
var_dump($f==$e);
var_dump ($ti).'<br>';
echo (
$end - $start);

?>


Details

Yet Another Hash package is a simple package to generate hash for string That will be secure enough to be used for keeping track of user password or other sensitive information.The generated hash has no default method to reverse it...The generated hash has a max length of 32 characters just as a md5() hash but is more secure than a simple md5 or sha1.An optional cost can be specified to make the hash more difficult to be cracked one day.The hashmore class also take as parameter an array reference that will contains in the output the timestamp salt value at index one and a shuffle value of this timestamp at the index two. The only way to check a hash value is to used this array and the exact cost of the hashmore class used to generate the hash... How to use: $x=new Hashmore(new Hashids()); $e=$x->secretstr('leizmo@gmail.com','',10,$ti); or $e=$x->secretstr('first string here','other string here',10,$ti); //$ti will then contains as said above the specific timestamp to use to check after if the passed string is the same // you will need this array but also the cost here 10 //just as: $f=$x->secretstr('leizmo@gmail.com','',10,$ti); or $f=$x->secretstr('first string here','other string here',10,$ti); //then if($f==$e) 'echo you are welcome'; else echo 'get out here .....'; Note:First time you use the last parameter(&$time) you don't need to specify a value but you can specify a boolean value or a specific float value and even an array.A boolean value will be considered as if you have used time() or microtime() function .A float value will be taken as if you specify a specific timestamp.In the two cases a new hash string will be generated. You can see some basic test in the testHashmore.php... Finally you must be aware that the package has as dependency hashids/hashids that you can simply install with composer(composer require hashids/hashids) or manually by downloading it at https://github.com/ivanakimov/hashids.php.git and install it You can also globally install dependencies and autoloader by simply use composer with update command. Please report bug and other at leizmo@gmail.com or use the forum to do it...

  Files folder image Files (5)  
File Role Description
Accessible without login Plain text file composer.json Conf. composer dependencies json file
Plain text file Ezama_Hashmore.php Class class source
Accessible without login Plain text file license.txt Lic. license file
Accessible without login Plain text file readme.txt Doc. readme
Accessible without login Plain text file testHashmore.php Example example script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:91
This week:0
All time:9,939
This week:673Up