I am building a Windows Form Application for a website. The application fetches data from the remote database server of the website and stores in local database at client side. What I want is that when I change the database connection password at the server side, the application should update that password in its settings file for the next time when it connects to remote database server.

What I tried to achieve this is that, when application starts, it downloads a file with encrypted password from the server and then updates its settings file with that password.

But I was wondering if any other optimized and more secure way available.