2006/1/21, Ben Vinger <[EMAIL PROTECTED]>: > Hello > > I've written a couple of scripts that check log files > on our WIndows and Unix servers. These scripts have > plain text passwords in them, so anyone who can access > the filesystem of the Windows server that runs the > scripts can discover the passwords of the servers. > Is there a way to hide/encrypt these passwords? Or > can the scripts be converted to compiled code in order > for the passwords to be hidden? > > > Thanks > Ben > >
Hello, Compiling a file in python is a big time loss,because there's not a built-in function for decompiling,but you can just use the 'dis'module for disassembling it and the result is always different from the original,because it uses Abstract Source Tree syntax in spite of Python language for translating the bytecode;on the other hand it wouldn't secure the file itself from being accessed but makes it useless IMHO.Thus,with a slight impact on complexity,a module with the crypted passwords would be imported, which would proceed for checking the passwords and exporting them in a StringIO object at runtime.For enhancing security,once used it could be removed and used again when needed,without removing the scripts themselves.You can check the 'crypt' module for this task. Cheers, Ivan _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor