' . "\n"; print 'You can download them.' . "\n"; die(); } if (substr($_GET['k'], 0, 2)=='0x') $_GET['k'] = substr($_GET['k'], 2); if (preg_match('/^[0-9A-Fa-f]{16,40}$/', $_GET['k']) !== 1) die(); header('Content-Type: text/plain'); $output = shell_exec('gpg -a --export ' . $_GET['k']); print $output; if (! empty($output)) die(); $fh = fopen('key-wishlist', 'a'); if ($fh !== false) { fwrite($fh, $_GET['k'] . "\n"); fclose($fh); }