After finding out how well BeautifulSoup worked on my N-Gage, I decided to try to find more modules that “just worked” on Python for Series 60. First up is blowfish.py, a project by Michael Gilfix. The file itself is not available directly from the author within the US, but Google cache can help with that.
The module is pure python, with absolutely no module dependencies. I have only tested it on the MMC with the full Python distribution on it, but this one (in theory) should work on a stock .SIS install without any addition python modules in your libs directory. It’s definitely not fast by any stretch of the imagination, but it may be a good building block if you want to add some crypto to your mobile application.
Here is the code that is being executed in the screen shot above:
import blowfish
key = 'hey, look over there!'
print 'generating the fish'
fish = blowfish.Blowfish(key)
print 'Plaintext:'
text = 'testtest'
print text
print 'Encrypting...'
crypted = fish.encrypt(text)
print 'Encrypted.'
# Printing encrypted chars causes barf
print 'Decrypting...'
decrypted = fish.decrypt(crypted)
print 'Decrypted:'
print decrypted
Comments
3 responses to “Blowfish in Your Pocket”
Is it desirable that I make this code available on my website? It seems to have shown up on various sites as an example of such a module and is now only available in the google cache. Please let me know.
Should you tell it — error.
This domain appears to recieve a great deal of visitors. How do you promote it? It offers a nice individual twist on things. I guess having something authentic or substantial to talk about is the most important factor.