assistenzde/simple-cryptographic-bundle
.env or a secrets manager).SimpleCryptographicService can be instantiated manually or via Laravel’s service container with minimal boilerplate.bundles.yaml and use Laravel’s config/ or app/Providers/ for configuration.openssl extension must be enabled (common but not universal). Laravel’s default php.ini typically includes this.APP_KEY (AES-256) is compatible with the default aes-256-ctr cipher..env) or relying on APP_SECRET may violate security best practices. Risk of key leakage if not managed via Laravel’s config/caching or a secrets manager..env, Laravel Vault, AWS KMS, or another solution?APP_SECRET (default key source) sufficient, or should a dedicated key be used?encrypt() (using openssl_encrypt under the hood) or a dedicated library like defuse/php-encryption be considered instead?config/app.php or a service provider:
$app->singleton(SimpleCryptographicService::class, function ($app) {
$config = config('simple-cryptographic-bundle', []);
return new SimpleCryptographicService($config['key'] ?? env('APP_KEY'));
});
config/ system to override defaults:
// config/simple-cryptographic-bundle.php
return [
'key' => env('CRYPTO_KEY'),
'cipher' => 'aes-256-gcm', // If supported
];
// app/Facades/Crypto.php
public static function encrypt(string $data): string { ... }
openssl extension is enabled in php.ini or Docker containers.aes-256-gcm may require OpenSSL ≥1.0.1).SimpleCryptographicService::encryptWithMethod()) for testing.base64_encode(mcrypt_encrypt())) with the bundle.deprecated() helper or feature flags.bundles.yaml; use Laravel’s config/ or service providers.encrypted, decrypted) to log/audit operations.aes-256-cbc, camellia-128-ofb) for performance/security tradeoffs..env or a secrets manager.config/simple-cryptographic-bundle.php.AppServiceProvider.error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt) may require cryptography expertise.Log::debug() in a wrapper).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Key loss/corruption | Permanent data loss | Backup keys |
How can I help you explore Laravel packages today?