Pure-PHP Keccak-256, SHA-3 and SHAKE hashing — the keccak256 primitive behind Ethereum addresses, ABI selectors and EVM signatures.
amashukov/keccak-php is a pure-PHP implementation of the Keccak / SHA-3 family of cryptographic hash functions, including the SHAKE extendable-output functions (XOF). It provides the keccak256 hash primitive used across Ethereum and other modern blockchains for address derivation, ABI function selectors and EIP-191 / EIP-712 message signing. Zero composer dependencies — only ext-mbstring from PHP core.
keccak256, address derivation and ABI selectors.224, 256, 384, 512.raw_output flag.ext-mbstring only.@PER-CS formatted, CI-tested.composer require amashukov/keccak-php
use Amashukov\Keccak\Keccak;
// Hex-encoded hash output (default).
$digest = Keccak::hash('hello world', 256);
// → 47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad
// Raw 32-byte binary output.
$raw = Keccak::hash('hello world', 256, raw_output: true);
Supported output sizes: 224, 256, 384, 512. SHAKE variants:
$xof = Keccak::shake('hello world', security_level: 128, outlen: 256);
ext-mbstringNo composer dependencies.
Part of a modular pure-PHP blockchain toolkit:
| Package | Purpose |
|---|---|
| amashukov/keccak-php | Keccak-256 / SHA-3 / SHAKE hashing |
| amashukov/secp256k1-php | secp256k1 ECDSA sign / verify / recover |
| amashukov/rlp-php | Ethereum RLP encode / decode |
| amashukov/ton-cell-php | TON TLB Cell / Builder / Slice / BOC |
| amashukov/abi-encoder-php | Ethereum ABI encoder |
| amashukov/eip1559-tx-signer-php | EIP-1559 transaction signer |
| amashukov/eth-rpc-client-php | Ethereum JSON-RPC client |
| amashukov/eth-php | EVM umbrella package |
@PER-CS ruleset.MIT License.
How can I help you explore Laravel packages today?