Wednesday, 27 June 2012

Minimalistic encoding


If I were encode this sentence: “Differentiation of the curve gives the tangent equation of the curve”
I realized then I was not using all the alphabets of the English language.

To show it in table form would be:
Symbol
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
No.
3

2
1
10
4
2
3
5




6
4

1
3
1
10
3
3





That would be mean the sentence has 16 unique symbols (alphabets). So only need to map these to another 16 unique combinations of symbols to encode the entire sentence.

Method 1: Fewer symbols to encode original symbols
4P3 gives us 24 combinations. Meaning there are 24 different ways to get a string of 3 letters picked from a list of 6 letters. If for this example I used numbers {0, 1, 2, 3};

Then the mapping would be:
Encoding
Symbols it represents
Encoding
Symbols it represents
Encoding
Symbols it represents
Encoding
Symbols it represents
012
A
102
F
201
N
301
S
021
C
120
G
210
O
310
T
013
D
103
H
203
Q
302
U
031
E
130
I
230
R
320
V

Method 2: Displacement of symbols in the list of symbols
Option 1: Starting from the beginning
Unique symbols are             {A, C, D, E, F, G, H, I, N, O, Q, R,  S,  T,   U,  V}
Displacement of symbols    {0, 1, 2, 3, 4,  5, 6, 7, 8, 9, 10,11,12,13,14,15 }

The original message
{‘D’, ‘i’, ‘f’, ‘f’, ‘e’, ‘r’, ‘e’, ‘n’, ‘t’, ‘i’, ‘a’, ‘t’, ‘i’, ‘o’, ‘n’, ‘ o’, ‘f’, ‘ t’, ‘h’, ‘e’  ‘c’, ‘u’, ‘r’, ‘v’, ‘e’ ‘g’, ‘i’, ‘v’, ‘e’, ‘s’  ‘t’, ‘h’, ‘e’ ‘t’, ‘a’, ‘n’, ‘g’, ‘e’, ‘n’, ‘t’ ‘e’, ‘q’, ‘u’, ‘a’, ‘t’, ‘i’, ‘o’, ‘n’ ‘o’, ‘f’ ‘t’, ‘h’, ‘e’ ‘c’, ‘u’, ‘r’, ‘v’, ‘e’}
{2,    7,  4,   4,   3,  11, 3,    8,  13, 7,  0, 13, 7,  9,     8,    9,   4,  13, 6,   3,    1, 14, 11, 15, 3,  5,  7,   15,  3,   12, … … …  … … …  … … …  … … …  … … …  … … …  … … …  … … …  … … …  … … …  … … …  … … …  15, 3}
Would be the encoded message

Option 2: starting from any point within the list
Suppose the random point we choice from the list was G. Then we would calculate the left and right displacements of all the other symbols
Unique symbols are             {A,  C,   D,  E,  F, G, H, I, N, O, Q,  R,  S,  T,  U,  V}
Displacement of symbols    {-5, -4, -3, -2, -1,0, 1, 2, 3,  4,  5,  6,  7,  8,   9}

In addition to the above options the position number can be stored in a vertical fashion so as to prevent people from decoding the message if they do not have the entire message

E.g.
Instead of writing 1,34,56,456,345
We can write as:
0
0
0
4
3
0
3
5
5
4
1
4
6
6
5
1
34
56
456
345

Option3: Paint a picture
we could equal colour variations to certain symbols/data. Then, a photograph could be manipulated such that the original picture is retained but, the colour intensity variations would store the encrypted data. So, to the ordinary person it would look just any old vacation photo.

No comments:

Post a Comment