2017 © Pedro Peláez
 

library crypt

windwork crypt component

image

windwork/crypt

windwork crypt component

  • Monday, June 26, 2017
  • by windwork
  • Repository
  • 1 Watchers
  • 1 Stars
  • 51 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Windwork 加密解密组件

可逆加密算法组件封装,目前支持AzDG、XxTea算法。, (*1)

// usage:

$key = '秘钥';
$txt = '明文~';

// 1、使用AzDG算法加密解密
$crypt = new \wf\crypt\adapter\AzDG();  
$enc = $crypt->encrypt($txt, $key); // 加密
$dec = $crypt->decrypt($enc, $key); // 解密

// 2、使用Xxtea算法加密解密
$crypt = \wf\crypt\adapter\Xxtea();
$enc = $crypt->encrypt($txt, $key); // 加密
$dec = $crypt->decrypt($enc, $key); // 解密

// 3、通过配置文件选择使用加密方式
$cfg = [
    'class' => '\\wf\\crypt\\adapter\\AzDG',
    'key' => 'value',
];
$crypt = $cfg['class']($cfg);

// 4、在Windwork框架中使用
$crypt = \wfCrypt();

安装

该组件已包含在Windwork框架中,如果你已安装Windwork框架则可以直接使用。, (*2)

  • 安装方式一:通过composer安装(推荐)
composer require windwork/wf
  • 安装方式二:传统方式安装
    下载源码后,解压源码到项目文件夹中,然后require_once $PATH_TO_WF/core/lib/Loader.php文件,即可自动加载组件中的类。




, (*3)

要了解更多?

The Versions

26/06 2017

dev-master

9999999-dev

windwork crypt component

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

encrypt decrypt crypt xxtea azdg

26/06 2017

1.0.4

1.0.4.0

windwork crypt component

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

encrypt decrypt crypt xxtea azdg

26/06 2017

1.1.0

1.1.0.0

windwork crypt component

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

encrypt decrypt crypt xxtea azdg

23/06 2017

1.0.3

1.0.3.0

windwork crypt component

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

encrypt decrypt crypt xxtea azdg

09/05 2017

1.0.2

1.0.2.0

windwork crypt component

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

encrypt decrypt crypt xxtea azdg

17/10 2016

1.0.0

1.0.0.0

windwork crypt component

  Sources   Download

MIT

The Requires

  • php >=5.5.0