Download the PHP package xgrug/laravel-gm-crypto without Composer

On this page you can find all versions of the php package xgrug/laravel-gm-crypto. 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 laravel-gm-crypto

laravel-gm-crypto 国密算法扩展包

Laravel 国密算法(SM3/SM4)扩展包,支持 SM3 哈希算法和 SM4 对称加密算法。

PHP Version Laravel Version

特性

安装

通过 Composer 安装:

发布配置文件(可选):

配置

环境变量配置

.env 文件中添加配置:

配置文件

配置文件位于 config/gmcrypto.php

使用方法

SM3 哈希算法

SM4 对称加密

在控制器中使用

在 Model 中自动加密

直接使用驱动

自定义配置

API 文档

SM3 类

方法

SM4 类

方法

支持的加密模式

支持的填充方式

实际应用场景

1. 敏感数据加密存储

2. 数据完整性校验

3. API 接口签名

安全建议

  1. 密钥管理:不要在代码中硬编码密钥,使用环境变量存储
  2. 定期更换密钥:建议定期更换加密密钥
  3. 使用 CBC 模式:相比 ECB 模式更安全
  4. HTTPS 传输:加密数据在传输时仍需使用 HTTPS
  5. 密钥长度:SM4 密钥必须为 128 位(32 位十六进制字符)

依赖要求

性能优化

测试

贡献

欢迎提交 Pull Request 或报告问题。

许可证

MIT License

相关资源

更新日志

v1.0.0 (2024-12-10)


All versions of laravel-gm-crypto with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2
illuminate/support Version ^10.0|^11.0|^12.0
ext-openssl Version *
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 xgrug/laravel-gm-crypto contains the following files

Loading the files please wait ...