Some Math Work 01; Part 02.

Coding&Decoding of numbers. 

MathWork01 Part 01 (intro)       MathWork01 Part 02       MathWork02  

Back home        Story index

(Reposted on 11 Oct 2003, remark that I just never took the time to check the 'number of decoding possibilities as found below. They could be wrong, so check stuff for yourself it you can.)

 

Introduction: On this page a 'worked example' of a text made from 700 letters. The letters are chosen from an alphabet containing 256 different symbols. Just try on your keyboard and type ALT159 (Keep the ALT button down while typing 159). With a bit of luck you see the symbol ƒ (the old Dutch guilder symbol). When you type ALT415 (415 = 159 + 256) you get the same symbol again, also for every natural number k we have ALT159 = ALT(159 + k256). 
This means we can view the letters in the alphabet as being the natural numbers modulo 256.

Written out in binary representation; 159 = 10.011.111 (8 binary places) while 415 = 110.011.111 (9 binary places needed). The PC ignores the first 1 and this is very handy to our planned use.

Let's start with some hypothetical text of 700 symbols (including the blank spaces, from the first to the last we need exactly 700 symbols).

Two persons want to exchange this text over the internet, simply by decoding the original text and send it as (attachment to) some email. Or as email itself. For coding&decoding these persons only use the method described in part I, but they repeat this a lot of times with different 'building blocks'.
For those repeating use is some kind of parameter (secretly) spoken of. If you know the parameter you could, in principle, decode the code (so this is not a 'public key' kind of coding process.

Start of the coding: The 700 symbols are filled up with zero's (or with the first part of the original message) to the nearest power of 2, in this case to 1024 symbols. Remark 1024 = 210 and now we can devide the 1024 symbols through all the numbers 21, 22, ....., 29, 210 to define de 'building block' of the coding run at hand.   

Below we look at the parameter p = (1, 2, 3, ..., n-1, n). 
After use of this parameter, the endcode is in 256^u ways to decode, where u = 0,5*n*(n+1).
With a letter of 700 symbols we have n=10, so there are 256^55 = 2,84*10^132 different solutions to the decoding of the 1024 (or 700) symbols.

 

(To finish some later day....)

Start of coding:

3
 
1
 
4
 
5
 
9
 
2
 
6
 
5
 
5
 
4
 

Now each neighboring pair of ciphers is added (and may be corrected by 10):

4 5 9 4 1 8 1 0 9
You see; we have now 9 ciphers and so there must be some loss of information. If you try do decode the 9 cipher code you see there are 10 possible solutions, this fits with the idea of having 1 less cipher.
If we would, for example,  know the first 'true cipher' (the 3) then it would be easy to decode this string of 9 ciphers into the original sting of 10 ciphers.

But that would be a little to easy to decode. So we proceed further, from the string of 9 ciphers we form a new string of 8 ciphers in exactly the same way:

9 4 3 5 9 9 1 9
And so we go on and on until we are left with only one cipher, you can do the calculation for yourself. If I did not make a error, the last cipher will be 5. 

Now we add the first true cipher 3 and the last calculated 5. We add and find 8.
We are ready and our coding of 3145926554 is therefore 8459418109. 

If you know how the coding was done, the decoding is just plain sailing (try it yourself).

As far as I know (but I am very limited in my knowledge on this), this method is not in use anywhere (and if it would, no one would tell because the decoding is so simple).

You can easily change this method, for example, you could transform the original 3145926554 in two steps to 94359919 and then think of something to produce the 2 extra ciphers in front you need to decode it.
All other kinds of changes could be made, you could work with building blocks of 2 ciphers and add these blocks together (and lower by 100 if needed). Just as the latest example; the 3145926554 must be split up like this:
31 45 92 65 54

And so you calculate:

76 37 57 19

And just follow the same scheme as in the 'one cipher' manner.

You can repeat different method's after one another because there is no information loss. Because this method only will work if all bits are there (so you must have 0% 'package loss') it would be wise to combine this with some kind of 'self repairing' code. A self repairing code is, for example, found in all your CD players (some extra information is added to the original info and you can withstand a fair portion of information loss before you run into trouble). 

At last, you could use a building block of 1 'cipher' but chosen from an alphabet of 128 different 'letters' and each letter is represented via a number 000, 001, ..., 127. Just like the Alt159 = Alt415 (but that is with 256 different letters...). So you can code text as well (there is no need to restrict this to numbers....).
In principle everything on a computer is at some basic level represented as a (binary) number, so even things like pictures or video clips can be coded&decoded. But you must have some key to decode this, that key must be brought 'safely' to the one who must do the decoding.

We leave this cute little math alone, it's free to use like most of my creations. If you find a good place to use this, please inform me (just out of curiosity). And if you get rich from it, don't forget me please...

I will not write all kinds of theorems on this, if you are a mathematician you can do that for yourself.
(End of File&no update on this)

Back home        Story index