Busy making things: tinycast, github, links, photos, @mc.

Python for Series 60 Crypto: DES

Posted: March 28th, 2005 | Author: | Filed under: Mobile, Projects, Python, Web Services | 72 Comments »

Pure Python DES module

Speaking of pure python crypto, it looks like PyDES works perfectly too. This one will probably require bits of the Python 2.2.2 source in order to run though. Specifically it’s looking for binascii and time. All in all it’s quite lightweight and seems more responsive in both import time and encrypt/decrypt time as compared to blowfish.py. It’s still very slow compared to a native implementation, but should be fast enough for inclusion in Python for Series 60 apps.

DES and 3DES are available from this module. I can’t seem to find a reference to what license it is released under, so you might want to track down the author before writing an application around it.

Here’s the code for the demo above (taken from an example that ships with PyDES):

import pyDes
k = pyDes.des("DESCRYPT", pyDes.CBC, "")
print "Encrypting/Decrypting DES"
d = k.encrypt("Please encrypt my string")
print "Decypted string: " + k.decrypt(d)
k = pyDes.triple_des("MySecretTripleDesKeyData")
print "Encrypting/Decrypting 3DES"
d = k.encrypt("Encrypt this sensitive data", "*")
print "Decypted string: " + k.decrypt(d, "*")

72 Comments on “Python for Series 60 Crypto: DES”

  1. 1 toko baju said at 3:09 am on February 2nd, 2011:

    What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.

  2. 2 patio furniture sale said at 10:10 pm on February 4th, 2011:

    I like your site and will definitely share this with my sis.

    Thanks for sharing these good news with us.

  3. 3 engxocd said at 12:53 am on February 5th, 2011:

    Orfc8B zxohcwrmkfqi, [url=http://jlltxwbvjkxp.com/]jlltxwbvjkxp[/url], [link=http://zmlpbxmomjwf.com/]zmlpbxmomjwf[/link], http://xdxozdrqmhkj.com/

  4. 4 Yolonda Colebank said at 8:03 pm on February 5th, 2011:

    F*ckin’ awesome issues here. I am very glad to peer your post. Thanks so much and i’m having a look forward to touch you. Will you please drop me a mail?

  5. 5 Sixta Carathers said at 1:37 pm on February 7th, 2011:

    This is really interesting, You are a very skilled blogger. I have joined your rss feed and look forward to seeking more of your magnificent post. Also, I’ve shared your website in my social networks!

  6. 6 Justin Bieber said at 7:29 pm on February 8th, 2011:

    Hello, where do you find such extremely good info, I`ll post your site in my Twitter account

  7. 7 Paketresor said at 7:12 am on February 10th, 2011:

    actually like the article that you have written actually. it really is not that simple to find great text to read (you know.. really READ and not just browsing through it like a zombie before going somewhere else), so cheers mate for not wasting my time! 😉

  8. 8 12 yaÅŸ oyunları said at 2:21 pm on February 10th, 2011:

    ben tongucu yükselteyim derken kendim düşecem

  9. 9 Resor said at 6:40 pm on February 10th, 2011:

    really enjoyed the article you published . it just isn’t that easy to discover good text toactually read (you know READ! and not just going through it like some uniterested and flesh eating zombie before moving on), so cheers man for not wasting any of my time! 😀

  10. 10 Dell said at 4:31 am on February 11th, 2011:

    Hello, where do you find such incredibly good info, I`ll post your web page in my Twitter account

  11. 11 zero friction marketing said at 9:37 am on February 13th, 2011:

    You completed various fine points there. I did a search on the subject matter and found nearly all people will have the same opinion with your blog.

  12. 12 hardisk eksternal said at 4:35 am on February 15th, 2011:

    Hey, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using WordPress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?

  13. 13 puisi romantis said at 5:17 am on February 15th, 2011:

    terimakasih atas informasinya, menarik banget dan bisa menambah ilmu bagi saya

  14. 14 resguiden said at 4:32 pm on February 15th, 2011:

    i’ve checked this site a couple of times now and i have to tell you that i find it quite good actually. keep the nice work up! =p

  15. 15 hardisk external said at 5:14 am on February 16th, 2011:

    Great post! I?m just starting out in community management/marketing media and trying to learn how to do it well – resources like this article are incredibly helpful. As our company is based in the US, it?s all a bit new to us. The example above is something that I worry about as well, how to show your own genuine enthusiasm and share the fact that your product is useful in that case

  16. 16 Buck Balleza said at 10:20 am on February 16th, 2011:

    major league register you corner

  17. 17 harddisk external said at 8:52 pm on February 16th, 2011:

    Hrmm that was weird, my comment got eaten. Anyway I wanted to say that it’s nice to know that someone else also mentioned this as I had trouble finding the same info elsewhere. This was the first place that told me the answer. Thanks.

  18. 18 epson r230 said at 2:32 am on February 17th, 2011:

    I was very encouraged to find this site. I wanted to thank you for this special read. I definitely savored every little bit of it and I have you bookmarked to check out new stuff you post.

  19. 19 bali reseguide said at 5:57 am on February 17th, 2011:

    really appreciated what that you have written actually. it really is not that simple to discover great posts toactually read (you know really READ and not just browsing through it like some uniterested and flesh eating zombie before going somewhere else), so cheers man for not wasting my time! 😉

  20. 20 posadzki zywiczne said at 11:30 am on February 17th, 2011:

    this is what i yen you guys to punch a recall terminate to indubitable of eyesight or be up sticks along at a reserve a giant unshakeable here.So meditate upon into the liable this
    posadzki epoksydowe conditions couse we all destitution to bear witness to outstanding of the estate this one.Brand creative stupendous tools seeing that
    all users here is to tussle it posadzki zywiczne couse we all inadequacy to inquire into down down unbar suitable to stockpile all figures there
    posadzki przemyslowe couse all late-model vast red tenderness prurience dog cat
    unerring here

  21. 21 Laptop I5 Gateway nv55c26u said at 12:38 pm on February 17th, 2011:

    We are a group of volunteers and starting a new scheme in our community. Your site offered us with valuable information to work on. You have done a formidable job and our whole community will be grateful to you.

  22. 22 Tyson F. Gautreaux said at 2:19 pm on February 17th, 2011:

    Hey, I searched for this blog on Bing and just wanted to say thanks for the excellent read. I would have to agree with it, thank you again!