Re: TIB: Encrytion...


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

Re: TIB: Encrytion...




> I don't get it...Use proper commas... :-)
> I have _no_ idea what you mean. Why the graphics?
> Tell me how the input is made, and how the output is made, step by step.
> 

I re-read my own post, and I can see where it would be confusing to 
someone who didn't write it. Let's see if I can do a bit better.

The idea of the program was to encode a message in a single picture. 
This picture could then be sent between calcs. I choose pictures 
because I had a neat idea, nothing else. In other programs things are 
encoded in lists, or matrices, or whatever...all of which can be 
transferred between calcs. I guess I just like the dot patterns. 

The first part of the program was to input a message. This was done by 
storing to a string. Because the calc can't assign a value to spaces, 
all spaces needed to be entered as thetas. When the user presses 
enter, the entire string is converted into a list, with each element 
of the list being the number of the position of the letter in the 
alaphbet (Whew!) ie. A=1,B=2,C=3...@ is assigned the value 0.

Now that the message is converted into a list, the next step is to 
display it as a sequence of dots on the graph screen. I'm going to try 
to display the general idea of how each letter is represented.

(upper left corner of graph screen) 
|--------------
| 









€
















| 














€










   <- 
 are pixels that are OFF
| 



€





















   <- € are pixels that are ON
| 
























€


This would represent my name, JODY.
Now, obviously this is only a small number of pixels across the 
screen. The program would continue to display the message in this 
format from top to bottom until it got to the bottom of the screen 
(duh :P). When it gets to the bottom, the calc moves to the right 27 
pixels, goes back to the top, and starts over again. There is enough 
room on the screen to have 3 columns like this. 

Like I said before, this could be fairly easy to figure out. To avoid 
this problem each letter is encrypted before it's pixel is displayed 
on the graph screen. The encryption is done by adding a given number 
to the letter. It is important to keep in mind that all letters are 
treated as if they are numbers. Again, @=0,A=1,B=2...This is modular 
arithmetic - if the new number is greater than 26, it goes back 0 
(remember 0 is a space).

Now, instead of just picking a single number that each letter should 
be shifted by, I decided to have various numbers. This way, a graph of 
the letter frequency wouldn't reveal anything. With that in mind, I 
picked 14 numbers at random - each number being the amount of shift 
for the next letter. The 15th letter is shifted by the first number 
again. 

An example of the way JODY would look after being shifted might look 
like this. The list of shifts might be {2,3,5,4,3,6,1,2,4,3,3,5,6,3}, 
and the graph would look like 











€































€
















€


















€

























That should clear up the general idea of the program. 

However, if you want to be able to send a single picture-coded message 
to somebody else, there must be a way to decipher the message, and 
this must be encoded in the picture itself. The information that must 
be included in the dot pattern is the list of random shifts and the 
length of the message. I decided to include this information in the 
upper right corner, as a special sequence of dots. Each column 
represents one of the 14 numbers in the list, and its distance from 
the top of the screen represents the actual number. For example, the 
above mentioned list would be:





€






 
€





€





 
€

€



€€

€


€



€






€







€

 




€





€
 
{2,3,5,4,3,6,1,2,4,3,3,5,6,3}

I can't remember just how the length of the message was stored, but it 
was in a simialr way.

When the decryption program was executed it would first ask for a 
password. If the password was correct, it would then go to the upper 
left and reproduce the list of the shifts, based on the pattern of 
dots. If the password was incorrect, the calc would ignore the shifts. 
Then, as it was scanning each letter it would either compensate for 
the shift and display the correct letter, or it would not compensate 
for the shift and display gibberish. 

I hope that cleared up some of the confusion. If you have any 
questions now, I'm hoping that you can give them to me specifically.
(fingers crossed :))

Jody Snider
jody1@alaska.net


References: