Git Product home page Git Product logo

php-crypto's Introduction

php-crypto library

A Pure PHP (without any external PHP-extension) Implementation of BLAKE-256, GROESTL-256, JH-256, SKEIN-256 and KECCAK-256 hashing (cryptography) algorithms. shift-reality/php-crypto is licensed under the Apache License 2.0.

Installation (composer):

  1. Add git-repository:

"repositories": [ { "url": "https://github.com/shift-reality/php-crypto.git", "type": "git", "reference": "newlib" } ]

  1. require library:

"require": { "shift196/lib-akash": "1.0.*" }

Usage:

  1. Register default algo:

\Shift196\AKashLib\Hasher::regBuiltinAlgos();

  1. Register own hash function(algo):

\Shift196\AKashLib\Hasher::registerAlgo('MYHASH', new MyHashImpl());

MyHashImpl should implement \Shift196\AKashLib\IHashFunction interface.

  1. Make hash of hex-encoded data:

$algo = 'BLAKE256 or GROESTL256 or JH256 or SKEIN256 or KECCAK256';

$hashHex = \Shift196\AKashLib\Hasher::doHash($algo, \Shift196\AKashLib\InputDataSupplier::forHex($dataHex))->hex(TRUE);

  1. Create own data supplier:

Just extend \Shift196\AKashLib\InputDataSupplier and implement abstract method getInputData.

!!! !!! WARNING !!! !!! !!! Don't use internal classes from \Shift196\AKashLib\Util it can be changed without any notifications !!! !!!

TODO:

-use PHPUnit for testing -add more algos -write Perf & Password class

php-crypto's People

Contributors

shift-reality avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

php-crypto's Issues

cool project

are you going to build a php-miner of Monero coin?
they are all algos that CryptoNote mentioned

thanks to your contributions!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.