I have a python script where i am using username and password to to perform operation(get/delete)on server using rest api.
I want to encrypt password used in script so that people who open the script won't be able to see plaintext password.
req = requests.delete(url, stream=True, headers=headers, verify=False,
auth=('Administrator','password'))
second problem is if i go for xor encryption for temporary purpose like below
passwd = base64.b64decode("cGFzc3dvcmQ=")
req = requests.delete(url, stream=True, headers=headers, verify=False,
auth=('Administrator',passwd))
passwd don't work inside auth() function as a variable.
'pass'(a string) instead of thepassvariable. Also please consider not naming a variablepassanyway, 'pass' is a python statement, use e.g.password.