In a project I am working on, I needed to write some cron job scripts, which purpose is, to access some external API's, which have information that shouldn't be accessible by the public. The external APIs all require a username and password to make them accessible.
The client was concerned, that if somehow, someone, manages to hack the server, and we store the passwords in the script files for these API's, the hacker would gain access to the secure information, or could transfer out money from these API's to his own account.
To resolve this problem, basically, to make a second security layer on the whole application, I tought that I could eliminate the cron jobs, by writing a simple daemon application, which when started, asks for a password from the administrator. With that password, he decrypts the API access keys, and starts replicating the things that the cron jobs did before.
The biggest drawback to this, is that whenever the daemon stops for any reason, an administrator MUST restart it manually, but my client said that this is not a problem for him.
Basically, what I would like to know, is, how safe is this approach? Can a hacker, who manages to hack into the server, retrieve the admin password which was provided to the daemon when starting, from the memory?
The environment I use is PHP (I know that this is not the best solution to daemon scripts, but time is of concern, and this was the fastest to implement).
What other drawbacks does this method has, that I haven't thinked about?