[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Playing Cards



From: [email protected] (Peter Hendrickson)
> A well shuffled deck of 54 cards has about 237 bits of entropy.  This
> is easy to use: the program asks the order of the cards, converts this
> to a string, and runs it through a one-way hash.  (Entering the cards
> is a bit of a nuisance.  Is there an easy way to have them read
> automatically?)

I heard that Bruce Schneier has devised a cryptosystem based on a card
deck for a future book by Neal Stephenson.  It is supposed to be simple
enough for a person to use manually, but complicated enough that it can't
be broken by computer.  Your idea of using cards as a one time pad is
somewhat similar, maybe, although I think Bruce's was designed to be
useful for long messages, providing computational rather than unconditional
security.

> How the Lisp Code Works
> -----------------------
>
> Let's use as an example a deck of five cards numbered from 0 to 4.
> There are 5! = 120 combinations of these cards.  We can think
> of each card as a "digit" in a slightly odd numbering system.

This is very interesting; I've never seen this algorithm before.  It
is a nice way to turn a number into a permutation, and vice versa.

> For an exercise, what is the value of (4 2 1 3 0)? (Answer at end.)

This would be 4*4! + 2*3! + 1*2! + 1(was 3)*1! + 0*0!, or as you say:

> ;; (Exercise Answer: (4 2 1 3 0) = 111)

Hal