I'm struggling with kinda old application which is written for Windows and has a 2-layer approach, meaning that the client SW is connecting to backend database directly.
This of course mean that the client SW needs a username and password to be able to open connection to database. All of these are configured and stored in Windows registries. Currently stored credentials are encrypted using symmetric key which is hardcoded together with initial vector in code.
Moreover the client SW is distributed with configuration to other places.
From my point of view this is not correct approach as the credentials can be retrieved when you have access to system. I understand that it should be somehow encrypted so it is not distributed in clear text, but still...
I am thinking and trying to find the right solution to secure password and access to database and I always end up with the change of architecture from 2-layer to 3-layer, where backend server will publish API, have a user management, and only server backend application will have a direct access to database installed on it.
Do you think it can have a better solution? In a current setup I think I can only protect credentials using encryption or obfuscation to make it harder for potential attacker to retrieve it. For someone with the knowledge of the SW will be easy to get it.