2017 © Pedro Peláez
 

library laravel-3des

Laravel Des3 encode

image

youthage/laravel-3des

Laravel Des3 encode

  • Saturday, April 28, 2018
  • by YouthAge
  • Repository
  • 0 Watchers
  • 0 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 413 % Grown

The README.md

Laravel 3DES

Laravel 3DES加密解密,和java,ios互通,使用openssl,必须有openssl扩展, (*1)

安装方法

composer require youthage/laravel-3des

配置方法

配置加密key和iv,如下。也可动态使用key和iv, (*2)

config文件夹下创建baseconfig.php

内容
<?php


return [

    'DES3_KEY' => 'ABCDEFGHIJKLMNOPQRSTUVWX',

    'DES3_IV' => '12345678',

];

使用方法

<?php

namespace App\Http\Controllers;

use DES3;
class IndexController extends Controller
{
    public function index()
    {
        // 加密
        $encrypt = DES3::encrypt(111);
        echo $encrypt;

        // 解密
        $decrypt = DES3::decrypt($encrypt);
        echo $decrypt;

        // 动态使用
        DES3::encrypt(111, 'ABCDEFGHIJKLMNOPQRSTUVWX', '12345678');
        DES3::decrypt($encrypt, 'ABCDEFGHIJKLMNOPQRSTUVWX', '12345678');
    }
}

The Versions

28/04 2018

dev-master

9999999-dev

Laravel Des3 encode

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

by Avatar YouthAge

28/04 2018

3.1

3.1.0.0

Laravel Des3 encode

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

by Avatar YouthAge

13/04 2018

3.0

3.0.0.0

Laravel Des3 encode

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

by Avatar YouthAge