This commit is contained in:
Hamza-Ayed
2026-04-28 14:14:11 +03:00
parent 76d06a4140
commit 3fa9aee14e
6 changed files with 21 additions and 20 deletions

View File

@@ -76,10 +76,11 @@ require_once __DIR__ . '/Auth/JwtService.php';
// 6. تهيئة Encryption Helper العام (للتوافقية)
// يتم استخدام .enckey (32 بايت) لتشفير البيانات
$encKey = trim(@file_get_contents('/home/intaleq-api/.enckey') ?: '');
if (!$encKey) {
$encKey = getenv('ENC_KEY') ?: '';
}
$encKeyPath = getenv('ENCRYPTION_KEY_PATH');
$encKey = trim(@file_get_contents($encKeyPath) ?: '');
if (!$encKey) {
$encKey = getenv('ENC_KEY') ?: '';
}
if (!$encKey || strlen($encKey) !== 32) {
error_log("[FATAL] Encryption key (.enckey) is missing or invalid length (must be 32 bytes).");