More Python for Series 60 Crypto: Rijndael

Rijndael on Series 60

During my search for pure python Nirvana I came across Bram Cohen’s rijndael.py. It can work with strings of length 16, 24, or 32. Here’s the sample code that ran successfully (albeit slowly) on my Taco:

# Make sure rijndael.py is in your libs dir
from rijndael import rijndael
# key must be 16, 24, 32 characters long
key = 'sixteencharacter'
r = rijndael(key, 16)
# must encode/decode in the chosen blocksize
print 'Encoding/Decodingnusing Rijndael...'
plaintext = 'themonkeygoeswoo'
ciphertext = r.encrypt(plaintext)
print r.decrypt(ciphertext)

It took its sweet time to run, but isn’t much more painful than waiting for import urllib, so it’s not the end of the world. It requires copy and string, which I’m not sure are in the Nokia distribution, but it works just fine if you dump the Python 2.2.2 source libraries in to your libs directory.

Add this one to your mobile cryptography toolbelt.

4 Responses to “More Python for Series 60 Crypto: Rijndael”


  1. 1 samir Apr 23rd, 2005 at 11:19 am

    bonjour
    je suis un étudiant al’univérsité des science et de la téchnologie d’oran algerie.je continue mes études(1ére année informatique) et en méme temp je fait des recherche sur l’algorithme de rijndeal ou la méthode dela cryptographie aes (advanced encryption systéme) je besoin des application sur cette méthode avec builder c++ s. v.p.
    E-mail:s210780@yahoo.fr

  2. 2 Hanne Jul 8th, 2005 at 5:08 pm

    So what? I love Pythons!

  3. 3 grshjzim goephia Aug 18th, 2008 at 7:52 pm

    evgrnycz wxtlirefn vswgkib ywxjh xazpknw uvawl alpqs

  1. 1 link Trackback on Jul 31st, 2007 at 4:36 pm

Leave a Reply