aichenk/open-crypt

1.0.1 2019-11-28 02:02 UTC

This package is auto-updated.

Last update: 2024-10-28 12:36:14 UTC


README

简单php加密类,基于openssl

运行环境

  • PHP 7.2+
  • openssl extension

安装方法

    composer require aichenk/open-crypt

使用

$crypt = new Crypt();
$crypt->setKey('12345678');
//$crypt->setCipher('des-ecb');
//$crypt->setIv('fff');
$text = 'test1234';
$encryptText = $crypt->encrypt($text);
$decryptText = $crypt->decrypt($encryptText);

命令行

  1. php执行

     php bin/encrypt text [key]
     php bin/decrypt encryptText [key]
    
  2. 系统命令(composer 引入,项目根目录下)

      vendor/bin/encrypt text [key]
      vendor/bin/decrypt encryptText [key]