Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 27th, 2005, 1:28 PM   #1
Eragon229
Newbie
 
Join Date: Jul 2005
Posts: 14
Rep Power: 0 Eragon229 is an unknown quantity at this point
Question Password Code Problem

Hi. I'm new. I'm trying to use a code to make my program password protected. It keeps saying:
while password != "abcddcba":
NameError: name 'password' is not defined


Thanks.
Eragon229 is offline   Reply With Quote
Old Jul 27th, 2005, 1:50 PM   #2
Riddle
Programmer
 
Riddle's Avatar
 
Join Date: May 2005
Location: Nar Shaddaa
Posts: 42
Rep Power: 0 Riddle is on a distinguished road
Send a message via ICQ to Riddle Send a message via AIM to Riddle Send a message via MSN to Riddle
Insert this somewhere in your code (before this while loop starts)..
password=""
Riddle is offline   Reply With Quote
Old Jul 27th, 2005, 2:00 PM   #3
Eragon229
Newbie
 
Join Date: Jul 2005
Posts: 14
Rep Power: 0 Eragon229 is an unknown quantity at this point
Thanks.
Eragon229 is offline   Reply With Quote
Old Jul 27th, 2005, 6:30 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,885
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
The password will be hidden in the source code, so people could easily retrieve it. Raise security by creating your own encrypt and decrypt function, then pre-compile the python file.
Sane is offline   Reply With Quote
Old Jul 27th, 2005, 7:10 PM   #5
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Quote:
Raise security by creating your own encrypt and decrypt function, then pre-compile the python file.
I couldn't disagree any more. String obfuscation just lulls the user into a false sense of security - much more dangerous than knowing what the risks are. You're going to have to include the code to get the file back to normal, and it doesn't take much time to go from there and retrieve the password. I suppose dynamically constructing the password string would be remotely helpful in that it will make the cracker take longer, or maybe just give up after a while.
Cerulean is offline   Reply With Quote
Old Jul 27th, 2005, 7:18 PM   #6
Riddle
Programmer
 
Riddle's Avatar
 
Join Date: May 2005
Location: Nar Shaddaa
Posts: 42
Rep Power: 0 Riddle is on a distinguished road
Send a message via ICQ to Riddle Send a message via AIM to Riddle Send a message via MSN to Riddle
Bah... if he's asking this question, I think that he is most likely not scripting something which really needs this security. I mean yeah, it's dandy and all, but is it needed?
Riddle is offline   Reply With Quote
Old Jul 27th, 2005, 8:29 PM   #7
Eragon229
Newbie
 
Join Date: Jul 2005
Posts: 14
Rep Power: 0 Eragon229 is an unknown quantity at this point
I'm not that advanced, just starting python. The least I can do is prevent access to the source code. How? I have no clue. I don't have to worry as long as that particular person does not have Python installed in the system. It'll open using command prompt.
Eragon229 is offline   Reply With Quote
Old Jul 27th, 2005, 9:15 PM   #8
Riddle
Programmer
 
Riddle's Avatar
 
Join Date: May 2005
Location: Nar Shaddaa
Posts: 42
Rep Power: 0 Riddle is on a distinguished road
Send a message via ICQ to Riddle Send a message via AIM to Riddle Send a message via MSN to Riddle
Quote:
Originally Posted by Eragon229
I'm not that advanced, just starting python. The least I can do is prevent access to the source code. How? I have no clue. I don't have to worry as long as that particular person does not have Python installed in the system. It'll open using command prompt.
If the person does not have Python installed on the system, it will not run- unless you use py2exe. In which case you'll need to give them the python DLL with it. Some people will say that py2exe is hard to use, but it's really not.. I dunno what their deal is.
Riddle is offline   Reply With Quote
Old Jul 28th, 2005, 6:00 AM   #9
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,885
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Quote:
I couldn't disagree any more. String obfuscation just lulls the user into a false sense of security... ... ...
That's why I said you then precompile it. But if you precompile it without making an encrypted string, you can still find the password inside the compiled file. At least if you encrypt it they'll have to guess how you did it, or find whatever thing is used to decompile python files.

He said he's new to Python, so that would probably be the easiest way for him.
Sane is offline   Reply With Quote
Old Jul 28th, 2005, 7:59 PM   #10
Eragon229
Newbie
 
Join Date: Jul 2005
Posts: 14
Rep Power: 0 Eragon229 is an unknown quantity at this point
Is there anyway to apply or open a Python program sent or found without having Python in the computer system or would you have to change the file type? I just need a simple answer so I know if it's possible in the future.
Eragon229 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:32 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC