$cipher, 'iv' => base64_encode($iv) ]; } function decryptText($cipher, $iv, $key) { return openssl_decrypt($cipher, 'AES-256-CBC', $key, 0, base64_decode($iv)); } function generateId() { return bin2hex(random_bytes(16)); }