Download the PHP package itjackjw/hyperf-encryption without Composer

On this page you can find all versions of the php package itjackjw/hyperf-encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hyperf-encryption

Hyperf 加密组件

组件当前仅实现了 AES 加密(OpenSSL 所提供的 AES-256 和 AES-128 加密)

所有组件加密之后的结果都会使用消息认证码(MAC)签名,使其底层值不能在加密后再次修改。

移植自 illuminate/encryption

安装

发布配置

配置文件位于 config/autoload/encryption.php

设置

在使用之前,你必须先设置配置文件中的 key 选项。你应当使用 php bin/hyperf.php gen:key 命令来生成密钥,这条命令会使用 PHP 的安全随机字节生成器来构建密钥。如果这个 key 值没有被正确设置,则无法进行加密。

使用

加密

你可以使用 \HyperfExt\Encryption\Crypt 类来加密一个值。所有加密过的值都会使用消息认证码 (MAC) 来签名,以检测加密字符串是否被篡改过:

加密的时候,对象和数组加密过的值都需要通过 serialize 序列化后传递。因此,非 PHP 客户端接收加密值,需要对数据进行 unserialize 反序列化。如果想要在不序列化的情况下加密或解密值,你可以将 Crypt::encrypt 方法的第二个参数设置为 false

解密

你可以使用 Crypt::decrypt 方法来进行解密。如果该值不能被正确解密,例如 MAC 无效时,会抛出异常 HyperfExt\Encryption\Exception\DecryptException

使用指定驱动

使用自定义加密类

实现 \HyperfExt\Hashing\Encryption\SymmetricDriverInterface\HyperfExt\Hashing\Encryption\AsymmetricDriverInterface 接口,并参照配置文件中的其他算法进行配置。


All versions of hyperf-encryption with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
ext-json Version *
ext-mbstring Version *
ext-openssl Version *
ext-swoole Version >=4.5
hyperf/command Version ~2.2.0
hyperf/di Version ~2.2.0
hyperf/framework Version ~2.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package itjackjw/hyperf-encryption contains the following files

Loading the files please wait ....