I have a password string that must be passed to a method. Everything works fine but I don\'t feel comfortable storing the password in clear text. Is there a way to obfuscate
If you just want to prevent casually glancing at a password, you may want to consider encoding/decoding the password to/from base64. It's not secure in the least, but the password won't be casually human/robot readable.
import base64
# Encode password (must be bytes type)
encoded_pw = base64.b64encode(raw_pw)
# Decode password (must be bytes type)
decoded_pw = base64.b64decode(encoded_pw)