I am currently building a small application which used a public API to get some information. The API doesn't support auto-login in any way (don't know if something like this even exists with APIs), but I don't want the user to have to login every time he uses the app. How can I achieve auto-login, when I need the username and the password of a user to connect to the API?
I thought about hashing but then the login to the API won't work. So maybe encryption is the solution, but firstly I don't know how I could generate and save a safe key and secondly you shouln't encrypt passwords (as you can read in many, many posts and articles). But I don't know what's left.
I don't have much experience with cryptography. Any advice or ideas?