הבנתי מה שאתה רוצה לעשות, אבל...
התוכנה שלך מחכה לdata ב stdin (standard input), אתה צריך למצוא איך לכתוב לstdin את הסיסמא... (לפחות ככה ניראה לי שצריך לעשות) אולי לפתוח את stdin עם fopen ואז לנסות לכתוב? הנה משהו שראיתי בהערות ברפרנס של fopen:
<? //GLOBALS $RETURN_CHAR = "\n"; $TIMEOUT = 5; //number of seconds to timeout on input $PID = getmypid(); $CHILD_PID = 0; //Make sure program execution doesn't time out set_time_limit(0); function set_timeout() { global $PID; global $CHILD_PID; global $TIMEOUT; $CHILD_PID = pcntl_fork(); if($CHILD_PID == 0) { sleep($TIMEOUT); posix_kill($PID, SIGTERM); exit; } } function clear_timeout() { global $CHILD_PID; posix_kill($CHILD_PID, SIGTERM); } // read_data() // gets a line of data from STDIN and returns it function read_data() { $in = fopen("php://stdin", "r"); set_timeout(); $in_string = fgets($in, 255); clear_timeout(); fclose($in); return $in_string; } // write_data($outstring) // writes data to STDOUT function write_data($outstring) { $out = fopen("php://stdout", "w"); fwrite($out, $outstring); fclose($out); } while(1) { write_data("say something->"); $input = read_data(); write_data($RETURN_CHAR.$input); } ?>
פה הם עושים דבר אחר, קוראים מstdin, מידע מהמשתמש... אולי זה יעזור לך לעשות את ההפך?

זה לא ממש ניראה הגיוני לכתוב לstdin, ואני לא יודע אם זו הדרך. בקיצור, כל מה שרשמתי כאן לא ממש עוזר.