Python Forum

Full Version: Encrypting Oracle Passwords / Python Library for That?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have numerous Python scripts that have been written over the past several years. Many of those interact with several Oracle databases in our office. Currently, all of those Python scripts have the Oracle DB usernames & passwords hard-coded directly in them.

I need to get away from that and, at minimum, have have the Oracle database username stored in the Python script, and make a call to some encrypted password stored Python library to pass-in the username and have the encrypted Oracle DB password returned back from that call.

I've researched this a bit and have seen that a library called Keyring is popular for this, and there looks to be a related library called keyrings.cryptfile (https://pypi.org/project/keyrings.cryptfile/) that deals specifically with encrypting whatever is stored in the library.

Any other suggestions, libraries, practical examples anyone can share as far as what's worked for them for this sort of privacy scenario to get away from having hard-coded passwords in your Python scripts?

Thanks!
There is a good user management package available here: https://pypi.org/project/Flask-User/
it uses Flask, but may be appropriate for storing your users.