How to hide a password in a Python script

How to hide a password in a Python script

Python, System Administration
Background Python is widely used for web scraping and APIs, dealing with databases, sending emails, and other tasks that may involve credentials, like a username or password. Luckily, there are several ways to hide a password in a Python script, as well as to store multiple passwords for many users if needed. In this post, we'll talk about three such packages - keyring, passlib, and cryptography, with a focus on the first two. How to hide a password in a Python script with keyring keyring is an easy-to-use package that works by allowing you to store a password in your operating system's credential store. It's great in that it can work across multiple different operating systems. To get started, just use pip to install: [code] pip install keyring [/code] Next,…
Read More