MCPcopy Create free account
hub / github.com/error311/FileRise / decryptForTest

Function decryptForTest

tests/security/auth_security_regressions.php:27–35  ·  view source on GitHub ↗
(string $data, string $key)

Source from the content-addressed store, hash-verified

25}
26
27function decryptForTest(string $data, string $key): string
28{
29 $cipher = 'AES-256-CBC';
30 $raw = base64_decode($data);
31 $ivlen = openssl_cipher_iv_length($cipher);
32 $iv = substr($raw, 0, $ivlen);
33 $ct = substr($raw, $ivlen);
34 return openssl_decrypt($ct, $cipher, $key, OPENSSL_RAW_DATA, $iv) ?: '';
35}
36
37function writeEncryptedJson(string $path, array $payload, string $key): void
38{

Callers 1

readEncryptedJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected