(string $data, string $key)
| 16 | putenv('FR_TEST_USERS_DIR=' . $usersDir); |
| 17 | |
| 18 | function encryptForTest(string $data, string $key): string |
| 19 | { |
| 20 | $cipher = 'AES-256-CBC'; |
| 21 | $ivlen = openssl_cipher_iv_length($cipher); |
| 22 | $iv = openssl_random_pseudo_bytes($ivlen); |
| 23 | $ct = openssl_encrypt($data, $cipher, $key, OPENSSL_RAW_DATA, $iv); |
| 24 | return base64_encode($iv . $ct); |
| 25 | } |
| 26 | |
| 27 | function decryptForTest(string $data, string $key): string |
| 28 | { |
no outgoing calls
no test coverage detected