Lets assume the following scenario

I am writing an application where you can log in and then provide login details to another system ie your email account, FTP account etc
The application then reuses those login details later when it tries to log into those services to perform a certain task. Those tasks are performed in the background via a cron script and the user does not want to have to log in every time to provide the login details to those services.
This means I need to store the...

How to store passwords and be able to reuse them later