root password in a .py script

Wayne Folta wfolta at netmail.to
Fri Mar 12 18:34:12 EST 2004


As others have pointed out, it's totally insecure, but I had to do 
something similar so did...

import string

unshifted = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
shifted   = 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM'
rot13_table = string.maketrans(unshifted, shifted)

user = string.translate ('sjkeiulkje', rot13_table)
passwd = string.translate ('eorpoipoe', rot13_table)





More information about the Python-list mailing list