Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encrypting db connection string

I come from .NET world.

In python code I have database connection string. Is there any way to keep these connection strings encrypted within python code?

like image 441
RKh Avatar asked Jul 09 '26 19:07

RKh


1 Answers

Securing the DB configuration or any sensitive configurations can be done by keeping configs encrypted. In python you can do it using packages like secureconfig or encrypted-config or DIY with some standard encryption techniques.

Keeping the encryption keys outside is the next challenge, which you can tackle by making it a injected config via environmental variables or a command-line-parameter.

like image 59
Kris Avatar answered Jul 11 '26 09:07

Kris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!