2017 © Pedro Peláez
 

library cryptokit

Cryptography helpers of Fruit framework

image

fruit/cryptokit

Cryptography helpers of Fruit framework

  • Friday, September 23, 2016
  • by Ronmi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 40 Installations
  • PHP
  • 2 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

CryptoKit

This package is part of Fruit Framework., (*1)

CryptoKit abstracts crypter, which encrypt and decrypt your data, and hash, which generates hashsum., (*2)

CryptoKit is still under development, not usable now., (*3)

Synopsis

Encrypt and decrypt some data

$data = 'hello world';
$crypter = new Fruit\CryptoKit\ROT13;

$encrypted = $crypter->encrypt($data);
$data = $crypter->decrypt($encrypted);

Encrypt or decrypt via stream

stream_filter_register('myfilter', 'Fruit\CryptoKit\CryptoFilter');
$f = fopen('myfile.txt', 'r');
stream_filter_append($f, 'myfilter', STREAM_FILTER_READ, [
    'crypter' => new Fruit\CryptoKit\ROT13,
    'crypt_type' => 'encrypt',
]);
$encrypted = stream_get_contents($f);
fclose($f);

Compute hashsum

$h = new Fruit\CryptoKit\Hash('md5');
$hashsum = $h->update($data)->sum();

Compute hashsum via stream

$f = fopen('myfile', 'r');
$h = new Fruit\CryptoKit\Hash('md5');
$hashsum = $h->updateStream($f)->sum();
fclose($f);

License

Any version of MIT, GPL or LGPL., (*4)

The Versions

16/11 2015

0.0.1

0.0.1.0

Cryptography helpers of Fruit framework

  Sources   Download

The Development Requires

by Ronmi Ren

12/11 2015

0.0.0

0.0.0.0

Cryptography helpers of Fruit framework

  Sources   Download

The Development Requires

by Ronmi Ren