ferdhika31/php-crispy 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ferdhika31/php-crispy

Composer 安装命令:

composer require ferdhika31/php-crispy

包简介

A custom Crypto utility PHP library that ports and wraps cryptography concepts from the go-crypsi module to make life easier when working with Digest, Cipher, HMAC, RSA, and RSA Digital Signatures natively in PHP.

README 文档

README

A custom Crypto utility PHP library that ports and wraps cryptography concepts from the go-crypsi module to make life easier when working with Digest, Cipher, HMAC, RSA, and RSA Digital Signatures natively in PHP.

Requirements

  • PHP 8.1 or higher
  • ext-openssl
  • ext-hash

Installation

You can install the package via composer:

composer require ferdhika31/php-crispy

(Note: During development, you can simply clone this repository and run composer install)

Features

The library is split into 4 core cryptography modules under the Ferdhika31\PhpCrispy namespace:

1. Aesx (Symmetric Encryption)

Provides AES encryption and decryption functions mapping to CBC, CFB, and GCM modes. It implicitly determines your AES key size (128, 192, or 256 bits).

use Ferdhika31\PhpCrispy\Aesx;

$key = "1234567890123456"; // 16 bytes = AES-128
$encrypted = Aesx::encryptCBC($key, "My Secret Data");
$decrypted = Aesx::decryptCBC($key, $encrypted);

2. Digestx (Hashing)

Provides easy-to-use variadic functions for standard checksums. Supports MD5, SHA1, SHA256, SHA384, and SHA512.

use Ferdhika31\PhpCrispy\Digestx;

$hex = Digestx::sha256Hex("hello", " ", "world"); 

3. Hmacx (Hash-based Message Authentication Code)

Provides HMAC signing capabilities guaranteeing data integrity, enforcing a minimum key length of 32 bytes for security.

use Ferdhika31\PhpCrispy\Hmacx;

$key = "super_secret_key_that_is_long_enough..";
$hmac = Hmacx::md5Hex($key, "My payload");

4. Rsax (Asymmetric Encryption & Signatures)

Provides RSA Key Generation, Public-Key Cryptography Standard (PKCS) Encryption via OAEP, and RSA Digital Signatures.

use Ferdhika31\PhpCrispy\Rsax;

// Generate pairs
$keys = Rsax::generateKeyPairs(2048);

// Sign Data
$signature = Rsax::signSha256($keys['private'], "Important Payload");

// Verify Data
$isValid = Rsax::verifySignSha256($keys['public'], "Important Payload", $signature);

Examples

To see full working examples for each algorithm, check the examples/ directory. Run them via terminal:

php examples/aes_sample.php
php examples/digest_sample.php
php examples/hmac_sample.php
php examples/rsa_sample.php

Testing

The library uses PHPUnit for robust testing. You can run the test suite by executing:

vendor/bin/phpunit tests

License

The MIT License (MIT). Please see License File for more information.

ferdhika31/php-crispy 适用场景与选型建议

ferdhika31/php-crispy 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 52 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ferdhika31/php-crispy 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ferdhika31/php-crispy 我们能提供哪些服务?
定制开发 / 二次开发

基于 ferdhika31/php-crispy 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 52
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 41
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-16