2017 © Pedro Peláez
 

library padding

FDevs Padding Component

image

fdevs/padding

FDevs Padding Component

  • Wednesday, July 27, 2016
  • by andrey1s
  • Repository
  • 3 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Padding

Build Status, (*1)

Installation

Padding uses Composer, please checkout the composer website for more information., (*2)

The simple following command will install fdevs/padding into your project. It also add a new entry in your composer.json and update the composer.lock as well., (*3)

composer require fdevs/padding

Usage examples

basic usage

<?php
use FDevs\Padding\Pkcs7;
use FDevs\Padding\NoPadding;

$padding = new Pkcs7();

$data = '';//your data without padding
$blockSize = 32;//your block size default 32
$paddingData = $padding->pad($data,$blockSize);

echo $padding->unpad($paddingData, $blockSize); 

usage with mcrypt

<?php
use FDevs\Padding\Pkcs7;

$padding = new Pkcs7();

$data = '';//your data without padding
$key = '';//your secret keys
$blockSize = mcrypt_get_block_size('des', 'ecb');

echo mcrypt_encrypt(MCRYPT_DES, $key, $padding->pad($data,$blockSize), MCRYPT_MODE_ECB);

$str = '';//crypto data
$paddingData = $str = mcrypt_decrypt(MCRYPT_DES, $key, $str, MCRYPT_MODE_ECB);

echo $padding->unpad($paddingData, $blockSize); 

License

This library is under the MIT license. See the complete license in the library:, (*4)

LICENSE

Created by 4devs - Check out our blog for more insight into this and other open-source projects we release., (*5)

The Versions

27/07 2016

dev-master

9999999-dev

FDevs Padding Component

  Sources   Download

MIT

The Requires

  • php >=5.5.9 || ~7.0

 

The Development Requires

27/07 2016

0.1.0

0.1.0.0

FDevs Padding Component

  Sources   Download

MIT

The Requires

  • php >=5.5.9 || ~7.0

 

The Development Requires