c2sp/wycheproof
Community-managed Wycheproof cryptography test vectors and JSON schemas. Validate crypto library implementations against known attacks and spec edge cases across many algorithms (AES-GCM, ECDSA, RSA, HKDF, ChaCha20-Poly1305, Kyber, Dilithium, more).
openssl, libsodium, or custom implementations) for features like:
ext-openssl, ext-sodium, or packages like paragonie/sodium_compat. Wycheproof can validate these dependencies at build/test time, reducing runtime vulnerabilities.Guzzle, Symfony\Component\Yaml, or native json_decode).openssl_* functions, Sodium\* methods).web-token/jwt-framework (for JWT validation).paragonie/sodium_compat (for modern crypto).phpseclib/phpseclib (for custom implementations).| Risk Area | Description | Mitigation Strategy |
|---|---|---|
| Algorithm Coverage | Not all Wycheproof vectors map 1:1 to PHP’s openssl/sodium. E.g., AEGIS, Ascon, or ML-KEM (Kyber) lack native PHP support. |
Prioritize vectors for supported algorithms (e.g., AES-GCM, ECDSA, ChaCha20-Poly1305). Use feature flags to disable unsupported tests. |
| Performance Overhead | Running 1,000+ test vectors in CI may slow down pipelines. | Parallelize tests (e.g., using PHPUnit’s --parallel). Cache test results for unchanged codebases. |
| False Positives/Negatives | PHP’s crypto functions may behave differently than Wycheproof’s expectations (e.g., padding schemes, key derivation). | Baseline against known-good libraries (e.g., libressl, BoringSSL) before integrating. Document discrepancies in Laravel’s security docs. |
| Maintenance Burden | Wycheproof’s test vectors evolve. Laravel’s crypto APIs may diverge from expectations. | Automate schema validation (e.g., using justinrainbow/json-schema). Subscribe to Wycheproof’s release notes. |
| Dependency Bloat | Adding Wycheproof may require pulling in heavy JSON parsers or custom crypto logic. | Use composer scripts to load vectors only during test phase. Avoid runtime dependencies. |
openssl_* implementation non-compliant, or is Wycheproof’s test incorrect)?json_decode() or Symfony\Component\Yaml for parsing vectors.openssl_* functions).paragonie/sodium_compat.pecl/openssl).tests/Feature: To integrate into existing test suites.WycheproofServiceProvider to load vectors and register test runners.php artisan wycheproof:test for manual runs.Wycheproof facade for easy test invocation.Phase 1: Proof of Concept (2-4 weeks)
WycheproofTestCase extending PHPUnit).openssl_encrypt() for AES-GCM).Phase 2: Core Integration (4-8 weeks)
testing package.Phase 3: Optimization & Maintenance (Ongoing)
| Component | Compatibility Notes |
|---|---|
| PHP Version | Requires PHP 8.1+ (for typed properties, attributes). Older versions may need polyfills. |
| OpenSSL Extension | Mandatory for RSA/DSA/ECDSA tests. Must be enabled (`php -m |
| Libsodium | Recommended for modern algorithms (ChaCha20, X25519). paragonie/sodium_compat provides fallback. |
| Laravel Versions | Works with Laravel 9+ (composer autoloading, PHP 8.1+). Older versions may need adjustments. |
| CI Environments | Tested on GitHub Actions, GitLab CI, CircleCI. Ensure Docker images include openssl and libsodium. |
| Unsupported Algorithms | For AEGIS/Ascon/Kyber, either: 1. Skip tests |
How can I help you explore Laravel packages today?