src/Leevel/Encryption/Encryption.php
protected function encryptData(string $value, string $iv): string
    {
        $value = openssl_encrypt($value, $this->cipher, $this->key, OPENSSL_RAW_DATA, $iv);

        if (false === $value) {
            throw new InvalidArgumentException('Encrypt the data failed.'); // @codeCoverageIgnore
        }

        return $this->packDataWithIv($value, $iv);
    }
protected function encryptData(string $value, string $iv): string
    {
        $value = openssl_encrypt($value, $this->cipher, $this->key, OPENSSL_RAW_DATA, $iv);

        if (false === $value) {
            throw new InvalidArgumentException('Encrypt the data failed.'); // @codeCoverageIgnore
        }

        return $this->packDataWithIv($value, $iv);
    }
加密数据.

@param string $value
@param string $iv

@return string