lizhichao/one-sm
lizhichao/one-sm is a lightweight PHP library implementing China's SM2, SM3, and SM4 cryptographic algorithms. It offers SM2 key generation, signing, verification, encryption and decryption, SM3 hashing, and SM4 symmetric encryption through a simple API for secure PHP applications.
lizhichao/one-sm is a Composer-installable PHP library for the Chinese national cryptographic hash SM3 (国密 SM3), with likely companion SM2/SM4 support that must be verified. It fits Laravel as a low-level crypto adapter behind application services, not as a replacement for Laravel’s Hash, Crypt, or Encrypter facades. SM3 is a digest primitive; it is appropriate for integrity checks, HMAC construction, and as the digest step in SM2 signatures. It is not a password-hashing/KDF algorithm by itself and should not replace bcrypt/Argon2 without a defined PBKDF2/HMAC-SM3 construction.composer require and direct class usage. Expect to write your own Laravel service provider, config, facade, and contract binding. Cross-check outputs against GM/T 0004-2012 test vectors and, where available, OpenSSL’s SM3 implementation. Binary digest handling requires disciplined hex/base64 encoding at boundaries.Sm3Hasher, Sm2Signer, or GuomiCrypto contracts, bind implementations in a service provider, and expose config for algorithm selection, encoding, and key references. Use feature flags per tenant/region so non-China deployments continue using existing OpenSSL/default crypto.ext-openssl, ext-mbstring, and Composer conflicts before adoption. Confirm binary output handling with database collations, JSON APIs, queue serialization, and Laravel encryption/session cookies. Ensure the package does not interfere with Laravel’s default OpenSSL-based encryption. Test under Octane and long-running workers for memory/state issues.How can I help you explore Laravel packages today?