next up previous
Next: Particle in a Box: Up: Codes Previous: Codes

Subsections

Nicias: A Card-based Encryption Algorithm

Introduction

This is an encryption algorithm inspired by the ``Solitaire'' algorithm (aka Pontifex) from The Cryptonomicon. After reading that book, I wanted to try out Solitaire, but I found it a pain to do all that counting and adding modulo 26. I tend to be absent minded, and thus have problems with both of these things (adding and counting).

So I decided to try to come up with a simpler card based encryption method, which hopefully will be just as secure. As a caveat, I am not a cryptologist, and have no idea whether the following algorithm is secure. However I am a physicist, and have some experience with random number generators. Specifically, I have been burned by the bad random number generator in the first edition of Numerical Recipes.

My encryption algorithm, Nicias2, does not require addition or subtraction, or even counting above seven. I had hoped to limit myself to counting to five, but that resulted in a clearly insecure algorithm, as I will discuss later.

I wanted to make my algorithm entirely reversible for two reasons. First, I read somewhere that this is a good idea, although I didn't really understand why. Secondly, this way if you make a mistake you may be able to reverse your tracks and redo it correctly.

Thirdly, it made it easier to test my algorithms by hand. I could encrypt a few letters with my deck in a known state and then reverse the process. If it returned to its original state I knew I had done it right. If not I had made a mistake. If I made mistakes too often, I knew the algorithm was too complex. One version required counting to nine, and that was too much. I don't know what mistakes I made, but I made them often enough to get very annoyed with myself. $\ddot\smile$

The Deck

In Nicias, the deck is always made up of alternating red and black cards, with a red card on top. The deck is always face up, so the top card is a red card, which you can see. You will never need to turn the deck upside down.

You can create a random deck in this order easily by simply taking a well shuffled deck and shifting the cards until they reach this order. Or, if that sounds complicated, you could sort out the red and black cards (keeping their order the same) and then reintegrate them.

Each black card corresponds to a cleartext character (since `black and white' means clear, sort of) and each red card represents a ciphertext character. Table 2.1 gives the correspondences of characters to cards.

Table 2.1: Cards and characters
A A$\diamondsuit$ A$\spadesuit$ N A$\heartsuit$ A$\clubsuit$
B 2$\diamondsuit$ 2$\spadesuit$ O 2$\heartsuit$ 2$\clubsuit$
C 3$\diamondsuit$ 3$\spadesuit$ P 3$\heartsuit$ 3$\clubsuit$
D 4$\diamondsuit$ 4$\spadesuit$ Q 4$\heartsuit$ 4$\clubsuit$
E 5$\diamondsuit$ 5$\spadesuit$ R 5$\heartsuit$ 5$\clubsuit$
F 6$\diamondsuit$ 6$\spadesuit$ S 6$\heartsuit$ 6$\clubsuit$
G 7$\diamondsuit$ 7$\spadesuit$ T 7$\heartsuit$ 7$\clubsuit$
H 8$\diamondsuit$ 8$\spadesuit$ U 8$\heartsuit$ 8$\clubsuit$
I 9$\diamondsuit$ 9$\spadesuit$ V 9$\heartsuit$ 9$\clubsuit$
J 10$\diamondsuit$ 10$\spadesuit$ W 10$\heartsuit$ 10$\clubsuit$
K J$\diamondsuit$ J$\spadesuit$ X J$\heartsuit$ J$\clubsuit$
L Q$\diamondsuit$ Q$\spadesuit$ Y Q$\heartsuit$ Q$\clubsuit$
M K$\diamondsuit$ K$\spadesuit$ Z K$\heartsuit$ K$\clubsuit$


The order of suits is that of sheepshead. You can remember this order because the rounder suits are always higher than the pointier suits. If you were playing sheepshead you would also want to know that the black suits are higher than the red ones. But you aren't.

A deck fashioned in this order provides a simple mapping from cleartext to ciphertext. You just find the black card corresponding to your cleartext, and the red card on top of it tells you the ciphertext. This is quite easy to do (that being the theme of this whole scheme).

The above method would provide a simple (and simple to crack) encryption scheme. What we need to do is to change the deck between each encryption in a manner that is hopefully indistinguishable from random. This requires some deck manipulations. In the following two sections I will describe the four deck manipulations I use.

Sliggle

This one is easy. You just take the bottom card (which is black) and exchange it with the next black card from the bottom.

Swap

This is the next easiest deck manipulation. It consists of finding a given two cards and switching their positions.

Cut-swap

The simplest way to randomize a deck, and one familiar to any card player, is the cut. It doesn't do much, but it is very easy to do. Unfortunately it isn't reversible. For example, if you cut a deck above the queen of hearts, the queen of hearts will be on the top of the deck. There is no such operation as ``uncut above the queen of hearts.'' So I introduce the swap to the cut-swap. You cut above the queen of hearts, and then swap the queen of hearts with the card that used to be on the top of the deck. This operation is its own inverse.

Actually, I define two cut-swaps. There is a red card on the top of the deck, so when you are told to cut-swap a red card, you cut above it and swap it with the former top card of the deck. There is a black card on the bottom of the deck, so you cut-swap a black card by cutting underneath it and then swapping it with the cormer bottom card of the deck.

This may sound a bit complicated, but it is actually very easy to do. It takes just a little while to get the hang of it, and then you can do it very reliably.

Transpose nxm

This is a slightly more complicated operation, but still pretty easy. You simply deal out n hands of m cards each face up off the top of the deck, starting on your left. Then you pick up the hands and place them back on the cards remaining in the deck, starting at your left. So the pile of cards on your right will be on the top of the deck.

The transpose gets its name, because if your deck is a one dimensional array, then this operation corresponds to treating the first nxm cards as an nxm matrix and then transposing this matrix (into a mxn matrix) and reversing its order.

If you don't follow that, don't worry. It is an easy way for me to think about the operation, because I have worked with matrices and are familiar with how they are laid out in memory. This has helped me to understand the operation, but it may not help you.

The transpose nxm is reversed by the transpose mxn operation. When I first started working on this I used a transpose 7x7, which is its own inverse. This is convenient and elegant, but has the downside that even with cutswaps in between, the transposes tended to reverse themselves. It was so bad that I could see that it was insecure just by doing it by hand, without using the computer!

The Shuffle

The shuffle is what I call the randomization procedure. It is the same whether you are encrypting or decrypting. In either case you know the cleartext character and you know the ciphertext character, because you can simply look the one up from the other, as described in ``The Deck.''

The shuffle proceeds as follows:

  1. Sliggle
  2. Cutswap the black cleartext card. This one comes for free, because you just looked it up (whether you are encrypting or decrypting).
  3. Swap the black card of the same rank as the bottom card with the black cleartext card (which you just cutswapped on).
  4. Cutswap the red cleartext card, that is, the red card corresponding to the cleartext letter.
  5. Transpose 3x17. You needn't bother counting to seventeen, since there will be only one card left when you finish.
  6. Cutswap the black card with the same rank as the bottom card.
  7. Transpose 5x7. Here is the infamous counting to seven part. Fortunately if you overcount, it's really easy to pick up the extra cards. Just don't undercount.

Primes

You may have noticed that the four numbers in the above scheme are all different primes. This is not an accident. If you use one number in both transposes, they interfere with each other and you get poor behavior.

Perhaps I should define poor behavior. My primary guide in developing this system (once I had developed the deck manipulations by hand) was the self correlation function when encrypting just one character again and again. For a good encryption method this character stream should be indistinguishable from random.

For more details on the analysis I used to try to ensure there were no correlations, see the last chapter.

Originally (not counting the miserable 7x7 which didn't require a computer to tell me it was messed up) I used a 3x17 transpose followed by a 3x3 transpose. This seemed like a nice idea, and only involved counting to three. Unfortunately, I found that often the same character could reappear after three characters. I tried many combinations looking at how often the same character would reappear after any number of characters. For a random sequence, the probability should always be $1/26$. I found that for my sequences this value was often as low as $0.7/26$. This was not good. Eventually I found that the above sequence of primes is good.

Unfortunately, even using four different primes is not enough. It is important to have just the right cutting. A small change in the above cutswapping sequence can have drastic effects on the randomness of the encrypted sequence. This is why all the other manipulations are in there (even down to the silly sliggle).

Moral of the story: I had to be very careful. Each operation interacts with the others, and can have unforseen consequences. One algorithm looked perfect, until a few hundered thousand characters into the sequence it started suddenly repeating itself. That was bad.

Other moral of the story: quite likely there is a hidden correlation in my cryptosystem which I am ignorant of (since I am ignorant of so much), and so I can't guarantee that it is any good. That is also why I'm putting it on the web, since I would love to have someone else find a problem with it so I could learn more.

Dealing with keys

In order to use this algorithm for encryption with a friend (and let's face it, there's no real reason to encrypt messages to yourself...), both you and your friend have to have decks identically arranged. The simplest way to do this is simply to meet with your friend and place them in the same order. If you don't want anyone to know that you are using this algorithm, you can sort the deck into all red and all black halves and then shuffle them together once. It will them look like a shuffled deck, and you can resort the decks before encrypting or decrypting. Unfortunately, this method has the problem that someone might steal (or copy) your friend's deck. $\ddot\frown$

There are many ways to deal with keys, but I'm not going to discuss them. I will just suggest one way to deal with it. I don't know if it is secure, but it may be, and it is reasonably convenient.

You start out with shared decks, plus two shared passwords. Before encrypting or decrypting, you encrypt the first password (but don't transmit the result!). This means that even if someone copied your deck, they will still have to guess your password in order to decode your message. After encrypting (or decrypting) you then encode your second password. This is necesary because the algorithm is reversible. If anyone steals your deck after you've encoded with it, and also intercepts your transmission, they could decode it. But first they'd have to guess your second password. To really be secure, your passwords would have to be long and random.

The convenience of this method comes along when you want to encrypt your second message. As long as the first message was received and decrypted successfully, you and your friend once again share identical decks. So you can encrypt another message using your two passwords again. Probably it would be best to have two decks each, one for encryption and one for decryption, since if both parties try to encrypt simultaneously with the same deck, it would be a pain to sort it out.

Conclusion

Nicias provides a much simpler to perform card-based encryption method than Solitaire. It only requires (for speed) memorizing correspondences of letters to cards, rather than letters to cards to numbers. It doesn't require any addition or subtraction, and also doesn't require counting above seven, whereas Solitaire can make you count to fifty three.

To the best of my knowledge, this algorithm is secure, but since my knowledge is pathetically limited, that isn't saying much.

Download

Here is a perl script to encrypt and decrypt with this algorithm, written to operate similarly to the Solitaire script ``sol.pl''.

Download perl script


Why Nicias?

I had to think of a name (in order to conveniently write this document), and I thought of a quote from Laches, my favorite platonic dialogue (which I would highly recommend, by the way).
SOCRATES: Come on then, Nicias, your friends are floundering in a sea of words! We've got ourselves hopelessly confused, so you'd better give us some help, if there's anything you can do.
Nicias (the algorithm) may not help you out of any philosophical difficulties, but it may be able to make plaintext out of your ciphertext.

Analysis of Nicias

I haven't done too much analysis. Essentially all I did was to analyze the probability of observing a given output n characters after it was seen in the output. This probability should be 1/26.

I also looked at the breakdown given the location in the deck at which the black cleartext card was located in the first place. This was intended to guide me as to where any problems might lie.

Thirdly, I considered different simple cleartext. One was all the same character (a), another two alternating characters (ab), and the third was three characters rotating (abc).

Of course, in each case we have to collect enough statistics to give a meaninful result, as determined by Poisson statistics. This can take quite a while, thanks to the $\sqrt{N}$ convergence, but such is life.

Without further ado, here are my correlations:

(a):
Correlation   1     2     3     4     5     6     7     8     9    10    11    12    13    error
Location  0:   2.7  -2.2  -0.3  -1.2  -0.9  -0.9   2.0  -0.5  -0.1   0.0  -0.6  -0.4  -1.4 +-  0.7
Location  1:  -2.0  -4.2   1.9  -0.9   0.5   0.5  -1.1   0.0  -0.3   0.1  -0.3  -0.9   0.6 +-  0.7
Location  2:   1.5   7.2  -0.6   0.6   0.0  -1.2   0.2  -0.9   0.3  -0.4  -0.4  -0.5  -0.9 +-  0.7
Location  3:   1.1  -8.8  -1.9   0.4   0.6   1.4   0.1  -0.4  -0.1  -0.3   1.2  -0.2   0.6 +-  0.7
Location  4:   1.0  -7.6  -5.1  -0.2   0.6   0.4  -0.1   0.1   0.5  -0.5  -0.3  -0.2   0.4 +-  0.7
Location  5:   1.3  -3.5  -0.7   1.0  -0.2  -1.7  -0.3   0.5  -0.5   0.3   0.0  -0.1  -0.6 +-  0.7
Location  6:  -3.0  -2.9  -2.4   0.2   0.2   0.2  -0.0   1.3  -1.0  -0.0   1.4   0.1  -1.5 +-  0.7
Location  7:   2.1  22.4  -3.8   1.2   0.4  -0.1   0.0   0.7  -0.2   0.7   0.6   0.4  -0.3 +-  0.7
Location  8:   0.9   1.6   3.5   0.5   0.6  -0.7  -1.1  -0.4   0.4  -0.5   0.1   0.1   0.2 +-  0.7
Location  9:  -0.1  -6.2  -2.6   0.6  -0.6  -0.3   0.4  -0.2   0.5   0.7  -1.3   0.1   0.7 +-  0.7
Location 10:   0.6  -2.8  -2.3   0.2   0.2  -0.4   0.7   0.0   0.5  -0.6   0.5  -0.3  -0.9 +-  0.7
Location 11:   1.6  -4.7   0.4  -0.6   1.1  -0.2  -0.5  -0.5   0.1   0.9   0.4   0.6   0.3 +-  0.7
Location 12:   0.8  -7.2  -0.3  -0.7   0.1   0.2   0.7   0.0  -0.1   0.5   0.6  -1.0   0.8 +-  0.7
Location 13:   1.5   7.2  -1.8   0.9  -0.1  -0.3  -0.3   1.5  -0.9   0.2  -0.5  -0.7   0.1 +-  0.7
Location 14:   1.3  18.7  -2.1  -0.6   0.3  -0.6   0.3   0.4   0.6   1.0  -0.0  -0.5   0.9 +-  0.7
Location 15:   2.1   7.0   2.5  -0.3   1.2  -0.0   0.3  -1.0  -0.2   1.4  -0.0   1.4  -0.4 +-  0.7
Location 16:   1.6  13.1   1.7   0.9   0.4  -0.2  -1.3  -0.6  -0.0  -0.1  -1.4  -0.2  -0.2 +-  0.7
Location 17:   2.1  -8.3  -0.9   1.4   1.2   0.1  -0.5  -0.6  -0.7  -1.3   0.3   0.9   1.0 +-  0.7
Location 18:   1.2  -5.7  -1.4  -0.6   0.1   0.2  -0.7   0.4  -0.9  -0.4   0.4   0.4  -1.1 +-  0.7
Location 19:   1.5   6.6  -1.6  -0.6   0.4   1.0   0.1   0.1  -0.6  -1.0   0.2  -0.0  -0.9 +-  0.7
Location 20:   1.2  -7.2   0.2  -0.3   1.3   0.9   0.3   0.9   0.2  -0.4   0.9   0.4   1.4 +-  0.7
Location 21:   0.9  -5.0  -0.4   0.1  -0.3   1.2   0.6   0.5  -0.5  -0.1   0.1   0.2  -0.8 +-  0.7
Location 22:   0.2   3.0   0.4   0.2  -1.2  -0.5   0.4  -0.1  -0.3  -0.4   1.0  -0.8   1.1 +-  0.7
Location 23:   0.5  -5.6  -2.9   0.3  -0.3   1.9   0.1   0.9   0.3  -0.2  -0.5  -0.2  -0.5 +-  0.7
Location 24:  -3.0 -10.9  -1.2  -0.5   0.1   0.4   0.8  -0.9  -0.2   1.8   0.0   0.5   0.3 +-  0.7
Location 25:   0.6   2.0  -2.1   1.9  -0.4   0.9  -0.2   0.2   0.0  -0.2   0.4  -0.8  -0.6 +-  0.7
   Total   :   0.78 -0.16 -0.91  0.15  0.21  0.08  0.03  0.06  0.13  0.05  0.10 -0.06 -0.07 +- 0.13
(ab):
Correlation   1     2     3     4     5     6     7     8     9    10    11    12    13    error
Location  0:  -0.6  -0.1   2.4   0.6  -0.5   0.3   0.3  -0.2  -0.9   0.7   0.3   0.4  -0.5 +-  0.6
Location  1:   3.2  29.8  -0.9  -1.0   0.5  -0.0  -0.3   0.1  -0.3  -0.4  -0.8  -0.4  -0.1 +-  0.6
Location  2:   0.1  -3.0  -1.6   0.1  -0.3  -0.7   1.2  -0.1   0.1   0.9  -0.3  -0.1   1.5 +-  0.6
Location  3:   0.2  -1.4  -0.5   0.3   1.1  -0.6   0.2  -0.5  -0.2   0.0   0.0   0.1  -0.2 +-  0.6
Location  4:   0.5  -4.0   3.8  -0.4   0.5   1.0  -0.0  -0.5  -0.3  -0.7  -0.6   0.6  -0.3 +-  0.6
Location  5:  -0.5  -3.9   0.6  -0.1  -0.4  -0.3  -1.2  -0.5  -0.1   0.3   0.6  -0.3   0.0 +-  0.6
Location  6:  -0.6  -1.2  -0.5  -0.5   0.5  -0.2   0.0   0.3  -0.4  -0.7  -0.3  -0.9   0.9 +-  0.6
Location  7:   2.0  -1.3   1.2   0.1  -0.0   0.9  -0.6   0.1  -0.3   0.0   0.4  -0.3   0.2 +-  0.6
Location  8:   0.4  -2.3  -1.0  -0.6   0.5   0.4  -1.2   0.3   0.5   0.8   0.1  -0.1   0.2 +-  0.6
Location  9:  -1.4  -2.9  -2.1  -1.3   0.2  -0.1   0.1   0.0   0.1  -0.1   0.8  -0.3  -0.1 +-  0.6
Location 10:   0.2  -0.9  -2.8  -0.1   0.2  -1.0   0.2  -0.3   0.7  -0.9   0.7   0.2  -0.3 +-  0.6
Location 11:   0.1  -2.4   0.3  -0.7   0.1   1.4   0.3  -0.7   0.4   1.5   0.1  -0.0  -0.7 +-  0.6
Location 12:   0.1  -2.2   0.1   0.6  -0.6  -0.4  -0.4  -0.7   0.4   0.2  -0.2  -1.1   0.2 +-  0.6
Location 13:   0.3  -2.8  -1.0   0.5   0.6  -0.4  -0.4  -0.9   0.5   0.1  -0.2   0.1   0.4 +-  0.6
Location 14:  -0.5  -3.6  -0.2  -1.5   0.2   1.1   0.5   0.5  -0.1   0.8  -0.7  -0.4  -0.3 +-  0.6
Location 15:   0.0  -1.4  -1.6  -0.6   0.2  -0.7   0.5   0.3   0.0   0.3  -0.8   0.1  -0.9 +-  0.6
Location 16:  -0.4  -2.3  -1.1  -0.8  -0.3   0.1   0.6   0.5  -0.3   1.5   0.4   1.3   0.7 +-  0.6
Location 17:  -0.8  -3.1   0.8  -0.1   0.7  -0.2  -0.0  -0.3   0.7  -0.6   0.7   0.1  -1.0 +-  0.6
Location 18:   0.2  -0.9  -1.3  -0.1   0.1  -0.7   0.0   0.1   0.6   0.2   0.5  -0.4  -0.2 +-  0.6
Location 19:  -0.5  -3.4  -1.0  -0.1   1.0  -1.0   0.0   0.2   0.1  -0.2   0.1  -1.7  -0.2 +-  0.6
Location 20:  -1.2  -2.7   1.0  -0.1   1.3  -0.0  -1.1  -1.0  -0.1   1.2   0.2  -0.6   0.5 +-  0.6
Location 21:   0.4  -3.1   2.5  -0.5  -0.4  -0.9   0.2  -0.2  -0.3   0.2  -0.6  -0.3  -0.4 +-  0.6
Location 22:  -0.0  -1.9   0.6   0.5   0.1  -0.0   1.2   0.0   0.7  -0.6  -0.6  -1.0   0.6 +-  0.6
Location 23:  -0.8  -3.0  -0.7   0.0   0.1   0.1  -0.1   0.2  -0.4   0.6  -0.3   0.0  -0.4 +-  0.6
Location 24:   1.7  -2.6  -2.1  -0.2  -0.3   0.3   0.6  -0.3  -0.2  -1.0   0.1  -0.1   0.3 +-  0.6
Location 25:   0.1  -2.7  -1.9  -0.0  -0.2  -0.0   0.2   1.1  -0.4   0.8  -0.2   0.0  -0.2 +-  0.6
   Total   :   0.09 -1.13 -0.27 -0.23  0.19 -0.07  0.03 -0.10  0.03  0.19 -0.02 -0.20 -0.02 +- 0.11
(abc):
Correlation   1     2     3     4     5     6     7     8     9    10    11    12    13    error
Location  0:   0.6  -1.7   0.4   0.2   0.1   0.6  -1.2  -0.7   0.3  -0.1   1.0  -0.0   0.4 +-  0.8
Location  1:   2.9  -0.5   4.9   0.4   0.3  -1.2   1.5   0.8  -0.2   1.4   0.4  -0.5   0.9 +-  0.8
Location  2:  -0.6  -0.1   1.8   0.4  -0.3  -0.7  -1.6   0.3   0.3  -0.4   1.2  -0.8  -0.9 +-  0.8
Location  3:  -1.1  -0.2   0.7   0.4  -0.1   0.1  -0.8   0.7   0.2   1.2  -0.5   0.1  -0.6 +-  0.8
Location  4:  -0.2   1.0   0.2  -0.9  -0.0  -0.5  -0.8  -0.9   0.7   0.4  -0.7   1.3   1.0 +-  0.8
Location  5:  -0.0  -0.8   0.2   0.7   1.1   0.6  -1.1  -0.1   0.1  -0.2   0.0   1.0  -0.8 +-  0.8
Location  6:  -0.4  -1.4  -0.3  -0.4   1.2   1.1   1.7  -0.4   0.3  -1.4  -0.2  -0.1   1.2 +-  0.8
Location  7:   0.8  -0.0  -0.2   0.0   1.2   1.0   0.6  -0.4  -0.4  -0.0   1.2  -0.1   0.4 +-  0.8
Location  8:   0.1  -1.4  -0.4  -1.2   0.3  -0.4   1.4   2.6  -0.4  -1.0   0.2   1.0   1.1 +-  0.8
Location  9:  -1.2  -0.2  -0.3  -0.7   0.4  -0.2   1.2   0.2  -0.1   0.8  -0.6  -0.3   0.3 +-  0.8
Location 10:  -0.3   1.1  -0.3  -0.5   0.3  -0.2   0.2  -0.5   0.7   0.2   0.7  -0.4  -1.8 +-  0.8
Location 11:   1.8   0.6   0.5   0.6   0.9  -0.1  -0.5   0.9  -0.5  -1.1   0.4   0.6  -0.5 +-  0.8
Location 12:   0.3  -0.3  -0.5   0.4   0.1   0.7  -0.4  -0.7   0.1  -1.1  -1.1   0.1   0.8 +-  0.8
Location 13:  -1.0  -0.6  -0.8   1.1   0.2   0.2   0.9   2.4   1.2  -1.0  -2.1   0.1  -0.5 +-  0.8
Location 14:  -1.5  -0.5  -0.3   0.9  -0.2   1.3  -1.3  -0.2   0.8  -0.8  -0.1  -0.5   1.3 +-  0.8
Location 15:   0.0  -0.4  -0.3  -0.1   1.1   0.1   0.5  -0.1   1.5  -0.5  -1.6  -0.6  -0.1 +-  0.8
Location 16:  -1.0  -1.4   1.0   0.1  -0.6  -0.7  -0.8   0.0  -0.4  -1.5   0.9   0.3  -0.5 +-  0.8
Location 17:   0.1   0.0   0.9  -1.7   1.2  -0.2   0.4  -1.3   0.0   0.5  -0.5   1.1   0.3 +-  0.8
Location 18:   1.0   2.0  -0.6  -0.9  -0.0  -0.3   0.0  -0.5   0.1  -0.3  -0.3  -0.1  -0.6 +-  0.8
Location 19:   0.1  -0.8  -1.3   1.2   0.0   2.4   0.5   0.4  -0.6   0.2  -1.0   0.2  -0.4 +-  0.8
Location 20:  -0.1   0.6  -1.2  -0.9   0.6   0.3   0.1  -0.5   0.5  -0.4   1.1  -0.5  -0.0 +-  0.8
Location 21:  -0.3  -0.5  -1.1  -0.3   0.2   0.2  -0.0   0.8   1.0   0.0   0.5   0.3   0.7 +-  0.8
Location 22:  -0.3   0.5  -1.1  -0.1  -0.0   1.1  -1.2  -0.4   0.8  -0.3  -1.0   0.0  -0.8 +-  0.8
Location 23:   0.2   0.9  -1.1  -0.4   0.1   0.7  -0.1   0.9  -1.3   0.4  -0.7  -0.7  -0.8 +-  0.8
Location 24:   1.5   0.4   0.4   0.5  -1.1   0.3   0.2  -1.4   0.1   0.8  -0.3  -0.6  -0.2 +-  0.8
Location 25:  -0.7   0.7   0.9   1.4  -0.2  -0.1   1.3  -1.3  -0.8   0.1   0.6   1.2  -0.7 +-  0.8
  Total    :   0.03 -0.11  0.08  0.01  0.25  0.23  0.03  0.03  0.15 -0.15 -0.10  0.08 -0.03 +- 0.15

The correlations are given in percent of the expected probability. So a correlation of -100% would mean that the character never appears, while a correlation of 2500% would be the maximum value, corresponding to the character always repeating. The standard deviation is given on the far right.

If you can't understand the format, you can email me to ask, or you can look at the code used to generate them:

Download perl script

The conclusion is that my worst correlations are about 1%, which happens when words like ``dada'' are encrypted. There is a similar correlation in the case of the encryption of repeated characters. The output when encrypting the ``abcabc'' sequence is consistent with a random sequence.

This seems pretty good to me, but I'm afraid I don't have much experience with encryption schemes, so it may not be. If you have any insights into this question, I would very much like to hear from you.


next up previous
Next: Particle in a Box: Up: Codes Previous: Codes
David Roundy 2000-09-18
Hosted by www.Geocities.ws

1