I'm looking for a sane way to use SQL Server to store, manage, and retrieve SFTP credentials, including passwords.
Right now, we have a table for SFTP credentials. We use a stored procedure to manage INSERTing to the table. The password column is a VARBINARY. We use EncryptByKey to encrypt the password, using a symmetric key that's on the server. We use a stored procedure to retrieve the information, with EncryptByKey to decrypt the password.
This seems like an exercise in futility to me, because anyone with access to the server could just decrypt the password with the key. It's better than storing the data as plain text, but only just.
What's the best way to manage this? I need to be able to use SQL to retrieve and decrypt the password.