dev-master
9999999-devFDevs Padding Component
MIT
The Requires
- php >=5.5.9 || ~7.0
The Development Requires
0.1.0
0.1.0.0FDevs Padding Component
MIT
The Requires
- php >=5.5.9 || ~7.0
The Development Requires
Wallogit.com
2017 © Pedro Peláez
FDevs Padding Component
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
<?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);
<?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);
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)
FDevs Padding Component
MIT
FDevs Padding Component
MIT