PHP Classes

PHP SHA3, SHA512, SHA384, SHA256, SHA224, SHA1, cSHAKE, KMAC, TupleHash, ParallelHash, KangarooTwelve, MarsupilamiFourteen: PHP implementation of the SHA hashing algorithms

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 175 All time: 8,778 This week: 36Up
Version License PHP version Categories
sha 1.0.0The PHP License5PHP 5, Cryptography
Description 

Author

This package provides a pure PHP implementation of the SHA hashing algorithms.

It provides class functions that can take a string of data and compute an hash using the different variants of the SHA hashing family of algorithms.

Currently it implements the algorithms: SHA3, SHA512, SHA384, SHA256, SHA224, SHA1, cSHAKE, KMAC, TupleHash, ParallelHash, KangarooTwelve and MarsupilamiFourteen .

Innovation Award
PHP Programming Innovation award nominee
December 2020
Number 8
SHA is a family of algorithms that process a string of data and compute a number called hash.

Hash computing is useful for several purposes. One of the purposes is to be able to check if the hash of a password entered by the user matches the hash of a password stored in a database.

This way, applications do not need to store plain text passwords in a database, which could cause a serious security problem in the case an application database gets stolen by people with bad intentions.

The package provides a pure PHP implementation of many variants of the SHA hashing algorithm family. Using this package you can implement strong data hashing based solutions, regardless of the PHP version that you use in your server.

Manuel Lemos
Picture of Jose Luis Lucas
Name: Jose Luis Lucas <contact>
Classes: 10 packages by
Country: Spain Spain
Age: ???
All time rank: 249163 in Spain Spain
Week rank: 192 Up6 in Spain Spain Up
Innovation award
Innovation award
Nominee: 7x

Documentation

SHA

Pure SHA-hashes (SHA1...SHA512,SHA3,cSHAKE,KMAC,TupleHash,ParallelHash,KangarooTwelve,MarsupilamiFourteen)

Based on: Publication Number: FIPS 180-4 Title: Secure Hash Standard (SHS) Publication Date: 08/2015

https://csrc.nist.gov/publications/detail/fips/180/4/final

SHA3 KECCAKp[1600,24] permutation

https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf https://keccak.team/files/Keccak-reference-3.0.pdf

http://incomsystems.biz/misc/doxygen/html/sha3_8c_source.html https://github.com/XKCP/XKCP/blob/master/Standalone/CompactFIPS202/C/Keccak-readable-and-compact.c

Based on the implementation by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni,

Joan Daemen, Michaël Peeters, Gilles Van Assche and Ronny Van Keer, hereby
denoted as "the implementer".

For more information, feedback or questions, please refer to our websites:
http://keccak.noekeon.org/
http://keyak.noekeon.org/
http://ketje.noekeon.org/
	

Test Vectors

https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/secure-hashing#sha3vsha3vss

$x=new SHA

$x->sha1($message); $x->sha224($message); $x->sha256($message); $x->sha384($message); $x->sha512($message);

$x->sha512t($message,$t);

$t=224,256...

$x->sha3("224",$message) $x->sha3("256",$message) $x->sha3("384",$message) $x->sha3("512",$message)

$x->sha3("SHAKE128",$message) $x->sha3("SHAKE256",$message)

$x->CSHAKE128($stream, $outputl, $N, $S), 256 $x->KMAC128($K, $X, $L, $S) , KMAC256, KMACXOF128, KMACXOF256 $x->TupleHash128($X, $L, $S), TupleHash256, TupleHashXOF128, TupleHashXOF256 $x->ParallelHash128($X, $B, $L, $S), ParallelHash256, ParallelHashXOF128, ParallelHashXOF256 $x->KangarooTwelve($stream, $S, $L, $MLEN) $x->MarsupilamiFourteen($stream, $S, $L, $MLEN)

@denobisipsis


  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file README.md Doc. Documentation
Plain text file shahash.php Class Class source

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  
 100%
Total:175
This week:0
All time:8,778
This week:36Up