Files
mirv dc3a466944 Выполнение шага 5:
• Updated Plan
  └ Продолжаю итерацию 5 как отдельный рабочий срез поверх текущих SSH credentials.
    □ Добавить модель/миграцию/repository для host_scans и покрыть repository тестами
    □ Добавить SSH command runner и LinuxHostScanner с whitelist read-only команд
    □ Подключить controller/routes/UI для запуска deep scan и просмотра результата
    □ Прогнать проверки и зафиксировать ограничения Docker-верификации
2026-05-29 17:34:27 +08:00

32 lines
675 B
PHP

<?php
declare(strict_types=1);
namespace Domovoy\Services\Security;
use Defuse\Crypto\Crypto;
class CredentialVault
{
private string $password;
public function __construct(string $keyMaterial)
{
if (trim($keyMaterial) === '') {
throw new \InvalidArgumentException('ENCRYPTION_KEY is required');
}
$this->password = $keyMaterial;
}
public function encrypt(string $plainText): string
{
return Crypto::encryptWithPassword($plainText, $this->password);
}
public function decrypt(string $cipherText): string
{
return Crypto::decryptWithPassword($cipherText, $this->password);
}
}