Hi Ivan I'm not sure I understand what you are saying here. Surely if the file is compiled it can just run (and will only need to be RE-compiled when I have to change the code (such as when one of the servers has their password changed). I would never need to de-compile, because I'll just keep a copy of the file on a memory stick, edit it there, compile it and replace the current compiled file with the newly compiled file. Not that I know anything about compiling Python programs, I just want to know if this is a possibility
Thanks Ben --- Ivan Furone <[EMAIL PROTECTED]> wrote: > 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 > ___________________________________________________________ Win a BlackBerry device from O2 with Yahoo!. Enter now. http://www.yahoo.co.uk/blackberry _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor