I'm in a bit of a pickle, i have a server application that need to login in mail servers of users.
The users give me mailserver username/password and the server application will login the mailserver and do stuff at a certain interval.
This means that i do need the plain password, so i can't use security measurements to safely store the password.
From research it seems i need to use 2 way encryption (server can encrypt but also decrypt). Encryption is done by using an encryption key.
What is the best way to handle/store this encryption key?
One thing that came to mind is storing the encryption key on another server, so if my application server and database get hacked they still don't have the encryption key. Although if the application server has access to other server the hacker can simulate (decompile, compile) my application on my application server and get encryption key this way.
It's a hard problem!