def xor(text, key):
    infkey = itertools.chain.from_iterable(itertools.repeat(key))
return ''.join(chr(ord(a) ^ ord(b)) for a, b in zip(text, infkey))
user = 'user'
encrypted_passwd = """
"""
key = 'key'
do_login(user, xor(encrypted_passwd, key))
How to hide username/password in Python codes?