pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
SolitaireCryptoDemo

SolitaireCryptoDemo - 1.1

John Eriksson (wmjoers)

Tags:

Description

A visual demonstration of the steps involved in generating a keystream using Bruce Schneier's Solitaire encryption algorithm.

Featuring smooth animations and descriptions of all steps.

Type "python SolitaireCryptoDemo.py" to start the demo.

You can also use several commandline options:

  • -r - Setup a shuffled deck.
  • -u - Setup an unkeyed deck.
  • -k KEY - Setup a keyed deck using the algorithm described at http://www.schneier.com/solitaire.html.
  • -o - Print found keys to standard out.
  • -h - Display this text.

Examples:

  • python SolitaireCryptoDemo.py
    starts the demo with a default deck (keyed with "CRYPTONOMICON").
  • python SolitaireCryptoDemo.py -r
    starts the demo with a shuffled deck.
  • python SolitaireCryptoDemo.py -u -o
    starts the demo with an unkeyed deck and prints the keys.
  • python SolitaireCryptoDemo.py -k MYSECRETKEY
    starts the demo with a keyd deck using the passphrase"MYSECRETKEY".

Changes

  • Fixed a serious bug in the key finding part of the algorithm. (Thanks to Thomas Knappe for pointing this out!)
  • Fixed some other bugs that I found when tracking down the first one.
  • Changed the key output to show the actual key value instead of the modulus 26 value. To be more compliant to the algorithm description.

Links

Home Page: http://arainyday.se/projects/python/SolitaireCryptoDemo/
Source: http://arainyday.se/projects/python/SolitaireCryptoDemo/SolitaireCryptoDemo-1.1.zip

Screenshot


click to view original size

Releases

SolitaireCryptoDemo - 1.2 - Oct 6, 2008
SolitaireCryptoDemo - 1.1 - Oct 5, 2008
SolitaireCryptoDemo - 1.0 - Feb 8, 2007

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

October 8, 2008 2:22pm - Nolan Baker - nickname: (nbaker) - 5/5
Much easier than using a real deck. Great job.
February 9, 2007 4:16am - John Eriksson - nickname: (wmjoers)
Should be somewhat more optimized now.
February 9, 2007 2:15am - John Eriksson - nickname: (wmjoers)
I would say the whole code is kind of dirty *smile*. For this first release I just wanted the output to be correct. When I get some time I'll optimize and tidy this code a bit.
February 8, 2007 8:18pm - Aaron Maupin - nickname: (maupin)
Looks very good. Nice and clean. I noticed that it uses 100% of the cpu, so you should add a pygame.time.wait(x) statement somewhere in your main loop. You also aren't using dirty rects, which would probably speed up the updates of your large window quite a bit.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

Sep 8, 2014

Sep 7, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)