I need some help to identify if my solution to store password on database is good (secure). Information security is a complex subject, so I'm not sure if my solution is weak or even overpower.
My application needs to save some users and passwords on database and use them to login in another application. This login happens only on the server side. We can call this users as "Providers". Each provider is identified with an unique id
, that come from the front-end application and it's necessary to know what provider needs to be used.
Store the passwords on plain text is not an alternative. So my idea is: cipher each password using some secret key with a different salt per provider. The secret key is saved on the server application (Kubernetes secret) and used, with the salt information, to decipher the passwords.
So, we will have a table like this:
+------------+-------------------------+---------------------+----+
| Name | Password | Salt | id |
+------------+-------------------------+---------------------+----+
| Provider 1 | 7c73c5a83fa580b5d6f8208 | feacbc02a3a697b0 | 23 |
| Provider 2 | 23291ac8bc335a1277a39d2 | 3a6acbc02a97b0fe | 88 |
+------------+-------------------------+---------------------+----+
As the quantity of Providers is very low (no more than 20), a different salt per provider seems a bit to much for me, but is a safer solution.
So, my question is: Is this solution secure for my scenario?