<?php
/**
* Created by PhpStorm.
* User: nassir
* Date: 2017/12/11
* Time: 15:25
*/
namespace Ryanc\RSA;
class AES
{
private $_cipher;// 加密方式
private $_key;// 密钥
private $_options = 0;// options 是以下标记的按位或: OPENSSL_RAW_DATA 、 OPENSSL_ZERO_PADDING
private $_iv = '';// 非null的初始化向量
private $_tag = '';// 使用 AEAD 密码模式(GCM 或 CCM)时传引用的验证标签
private $_aad = '';// 附加的验证数据
private $_tagLength = 16;// 验证 tag 的长度。GCM 模式时,它的范围是 4 到 16
public function __construct( string $cipher, string $key, int $options = 0, string $iv = '', string $tag = null, string $add = '', int $tagLength = 16)
{
$this->_cipher = $cipher;
$this->_options = $options;
$this->_tag = $tag;
$this->_aad = $add;
$this->_tagLength = $tagLength;
$ivlen = openssl_cipher_iv_length($cipher)
PHP利用openssl整理AES加解密类
最新推荐文章于 2024-07-26 15:45:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)