Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 6th, 2004, 09:07 PM
Questioner Questioner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Questioner's home
Posts: 89 Questioner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 32 m 10 sec
Reputation Power: 6
Beginner's encryption

I would like to encrypt the password for my program so that users cant easily open it up and change it. Also, I want to learn how to write it myself instead of using some library file, can someone be kind enough to do a simple demonstration on how to encrypt and decrypt?
__________________
What can change the nature of a man?

Reply With Quote
  #2  
Old January 6th, 2004, 11:25 PM
SolarBear's Avatar
SolarBear SolarBear is offline
onCsdfeu
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Canada
Posts: 100 SolarBear User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 7 m 43 sec
Reputation Power: 6
Send a message via ICQ to SolarBear Send a message via MSN to SolarBear
Well there are literally dozens of encryption methods, from the very simple Caesar cypher (A = B, B = C, C = D, etc.) to RSA.

You could use the md5 or sha modules ; just look at Python's library reference under section 15: cryptographic services.

If you really want to code your own, though, you should look for the Handbook of Applied Cryptography which is completely free. Not a beginner's book, though, but a precious resource nonetheless.

Reply With Quote
  #3  
Old January 7th, 2004, 12:11 AM
Questioner Questioner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Questioner's home
Posts: 89 Questioner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 32 m 10 sec
Reputation Power: 6
Interesting, I'd read the doc and md5 looks like a nice choice, I think I'll use that first b4 I write myself one, but how do you decrypt/undigest the encrypted/digested passwords?

Reply With Quote
  #4  
Old January 7th, 2004, 02:20 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 3 m 4 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
MD5 is nice, definatly one of the most well used encryptions.. the bad (or good depending on how you look at it) thing about this being there is no decryption, MD5 purly one way!

So if your working with passwords you're actually gonna need to compare rather than decrypt

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #5  
Old January 7th, 2004, 11:38 AM
oxygenthief oxygenthief is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 35 oxygenthief User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I've used this before, it works pretty well: http://home.pacific.net.au/~twhitema/des.html

This implementation is written in pure python, there is another written in C floating around somewhere, but I found the one I listed above to be a little easier to use. I think the C one implements other algorithms than DES and 3DES.

Reply With Quote
  #6  
Old January 7th, 2004, 11:29 PM
Questioner Questioner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Questioner's home
Posts: 89 Questioner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 32 m 10 sec
Reputation Power: 6
Or maybe I'll use rotor, is that a bad choice?

Reply With Quote
  #7  
Old January 8th, 2004, 12:00 AM
lazy_yogi lazy_yogi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 325 lazy_yogi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 58 m 36 sec
Reputation Power: 6
yes rotor is bad choice

Use md5 if it is for securing passwords.
It's one of most secure things. And that is due to the fact that you can't unencrypt it (unless you for a very long time anyway). Only compare the md5'ed inputted password to the stored md5-ed password

Reply With Quote
  #8  
Old January 8th, 2004, 02:00 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 3 m 4 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Add that to the fact that rotor was found to be insecure and was depreciated in Python 2.3 and i'm with Yogi on this one . Stick with md5...

Mark.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Beginner's encryption


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT