How to not hardcode passwords?

后端 未结 4 2116
广开言路
广开言路 2020-12-30 10:00

In my last question \"Portable database for storing secrets\" the best answer until now tell to use sqlite-crypt.

Reading sqlite-crypt docs, the new param for open

4条回答
  •  清酒与你
    2020-12-30 10:59

    Hardcoding is inevitable at some point, unless the password is only ever used interactively.

    The best thing you can do in a password-in-file situation is make it damn hard to access it in the first place, and then limit what can be done with it if someone does find it. A rule of thumb is that you shouldn't give more privileges to a password stored in a string than one that you have to type at a prompt.

提交回复
热议问题