Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To Whom It May Concern:
- The following is a tutorial on the processes involved
- in ME. We will cover creation of the encoding and
- decoding multidimensional arrays along with the use of
- them in the encryption and decryption processes
- respectively. Once understood, the basis for developing
- a more space efficient method can then be developed.
- Make Encoding Grid
- ------------------
- For our example, we will use the following key:
- iOUeaouEAI
- uEaIUieOAo
- IoUEaAOeiu
- The first line forms a one-dimensional template, and
- the second line instructs us to create a two-
- dimensional template where the beginning of each line
- starts with the given letter. This is accomplished by
- rotating the original template to match a given
- character. Thus, we should end up with the following
- two-dimensional template:
- uEAIiOUeao
- EAIiOUeaou
- aouEAIiOUe
- IiOUeaouEA
- UeaouEAIiO
- iOUeaouEAI
- eaouEAIiOU
- OUeaouEAIi
- AIiOUeaouE
- ouEAIiOUea
- Notice that this grid has two properties related to
- Sudoku. First, every character is unique on a row.
- Second, the same holds true for each column. It was for
- this reason that the key was once called a Sudoku key,
- and the property will be very important when developing
- a decoding algorithm.
- Now that we have created a two-dimensional template
- based on the one-dimensional template given in the
- first line of the key, we may now interpret the third
- line in the key. This tells us to form a new three-
- dimensional template where each stacked two-dimensional
- template is rotated to begin with the given letter. As
- a result, we come up with the following data structure:
- 0 1 2 3 4
- IiOUeaouEA ouEAIiOUea UeaouEAIiO EAIiOUeaou aouEAIiOUe
- iOUeaouEAI uEAIiOUeao eaouEAIiOU AIiOUeaouE ouEAIiOUea
- EAIiOUeaou eaouEAIiOU iOUeaouEAI ouEAIiOUea UeaouEAIiO
- UeaouEAIiO AIiOUeaouE ouEAIiOUea iOUeaouEAI EAIiOUeaou
- ouEAIiOUea OUeaouEAIi AIiOUeaouE eaouEAIiOU iOUeaouEAI
- eaouEAIiOU IiOUeaouEA uEAIiOUeao OUeaouEAIi AIiOUeaouE
- uEAIiOUeao UeaouEAIiO IiOUeaouEA aouEAIiOUe OUeaouEAIi
- aouEAIiOUe iOUeaouEAI EAIiOUeaou UeaouEAIiO IiOUeaouEA
- OUeaouEAIi EAIiOUeaou aouEAIiOUe IiOUeaouEA uEAIiOUeao
- AIiOUeaouE aouEAIiOUe OUeaouEAIi uEAIiOUeao eaouEAIiOU
- 5 6 7 8 9
- AIiOUeaouE OUeaouEAIi eaouEAIiOU iOUeaouEAI uEAIiOUeao
- IiOUeaouEA UeaouEAIiO aouEAIiOUe OUeaouEAIi EAIiOUeaou
- uEAIiOUeao IiOUeaouEA OUeaouEAIi AIiOUeaouE aouEAIiOUe
- OUeaouEAIi aouEAIiOUe uEAIiOUeao eaouEAIiOU IiOUeaouEA
- aouEAIiOUe EAIiOUeaou IiOUeaouEA uEAIiOUeao UeaouEAIiO
- UeaouEAIiO ouEAIiOUea EAIiOUeaou aouEAIiOUe iOUeaouEAI
- ouEAIiOUea AIiOUeaouE iOUeaouEAI EAIiOUeaou eaouEAIiOU
- eaouEAIiOU uEAIiOUeao AIiOUeaouE ouEAIiOUea OUeaouEAIi
- iOUeaouEAI eaouEAIiOU ouEAIiOUea UeaouEAIiO AIiOUeaouE
- EAIiOUeaou iOUeaouEAI UeaouEAIiO IiOUeaouEA ouEAIiOUea
- The numbers are to denote the individual levels of this
- data structure. Notice that part nine is exactly the
- same as the previous template. Since that template
- starts with a "u" and the last instruction in the third
- line of the key in a "u", the original template is used
- without modification. From here on, positions in the
- three-dimensional data structure will be given as
- (Part,Row,Column) with all numbers being zero based.
- To understand how the encoding grid was created, it may
- help to look at (9,0,1) and then compare this to
- (3,0,0). "E" is the fourth character in line three of
- the key instructions, so this would explain (3,0,0).
- Now if you compare part nine to part 3, you should
- notice that each line is rotated by one character to
- the left. Our original one-dimensional template is
- undergoing rotation transformations on every line.
- Encrypt
- -------
- Now that we have a grid with which to encode our data,
- let us define our initialization vector (usually called
- a primer in this context but once known as a boot
- strap) as the following:
- EU
- Our plaintext for encryption will be Genesis 1:1, and
- we will only encrypt letters of interest to us, the
- vowels referenced in the key. So the first letter that
- happens to be vowel is "I" from the word "In" (the
- first word in the verse). We then append this letter to
- the IV to form EUI. Let us rewrite that at (E,U,I).
- Now we have something that looks like a coordinate, but
- since there are no numbers, it cannot be used to access
- our three-dimensional grid. Recall the first line of
- the key, our one-dimensional template. This contains
- all of the characters that we will process. Let us
- perform a sorting operation on the template to get a
- well-defined order on our characters.
- iOUeaouEAI -> AEIOUaeiou
- We will now use the indexes of the sorted string to
- rewrite our three-dimensional coordinate. (E,U,I)
- becomes (1,4,2) when we replace the characters with the
- proper index positions. If you use this coordinate to
- access the three-dimensional grid, you will find the
- letter "e" which will replace the "I" found in the
- first word.
- The first character of our plaintext has been
- transformed into ciphertext, but there are still plenty
- of other characters to process. The string "n th"
- follows the "I" but does not contain any vowels and so
- will be written without any transformations. The "e" in
- "the" is a vowel and will require encryption, though.
- We need to create a new index to access our three-
- dimensional grid for the next ciphertext character. To
- do this, we will take (E,U,I), append the "e" we found,
- and drop the beginning "E" to maintain a length of
- three (the number of dimensions to our grid). Thus our
- new coordinate is (U,I,e). Written with indexes, this
- becomes (4,2,6).
- When we access our grid using (4,2,6), we find the
- vowel "A" which will replace our "e" found in the
- plaintext. So far, we have constructed the string "en
- thA" as the beginning of the ciphertext. From here, the
- rest of the replacements will be expressed in an
- abbreviated form from beginning to end. The format is
- plaintext character -> character coordinate -> index
- coordinate -> ciphertext character.
- I -> (E,U,I) -> (1,4,2) -> e
- e -> (U,I,e) -> (4,2,6) -> A
- e -> (I,e,e) -> (2,6,6) -> o
- i -> (e,e,i) -> (6,6,7) -> o
- i -> (e,i,i) -> (6,7,7) -> e
- o -> (i,i,o) -> (7,7,8) -> u
- e -> (i,o,e) -> (7,8,6) -> O
- a -> (o,e,a) -> (8,6,5) -> U
- e -> (e,a,e) -> (6,5,6) -> O
- e -> (a,e,e) -> (5,6,6) -> O
- e -> (e,e,e) -> (6,6,6) -> a
- a -> (e,e,a) -> (6,6,5) -> e
- e -> (e,a,e) -> (6,5,6) -> O
- a -> (a,e,a) -> (5,6,5) -> i
- e -> (e,a,e) -> (6,5,6) -> O
- e -> (a,e,e) -> (5,6,6) -> O
- a -> (e,e,a) -> (6,6,5) -> e
- That is a complete summary of how encryption works in
- ME. Each of the plaintext characters are replaced with
- ciphertext characters, and the remaining plaintext
- characters are not changed since they were of no
- interest to us. Of course, there is the option to
- encrypt these other characters with another pass
- through the encryption process using another key and
- primer. Our final ciphertext is the following:
- en thA bogonneng Gud crOUtOd thO haevOn ind thO Oerth.
- Make Decoding Grid
- ------------------
- The first thing you want to do to create a decoding
- grid is to create an encoding grid. Then recall the
- sorted template (AEIOUaeiou) we made up in the encrypt
- stage. We will call this our base. Now for every row in
- our three-dimensional grid, we are going to run the
- follow set of operations on them. Our first old row is
- "IiOUeaouEA", and "__________" will denote an empty new
- row.
- The first character in our old row is "I" and has an
- index of 2 in our base. So we are going to replace the
- third underscore in our new row. We will place it with
- the first character in our base. So our new row becomes
- "__A_______". The next old character is "i" with an
- index of 7. We will replace the eighth character in our
- new row with the second character (E) from our base so
- it becomes "__A____E__".
- If we continue this process of using the base index of
- the next character in our old row to change that
- position in our new row to be the next character in the
- base, then we will end up with the string "uoAIOaUEei".
- If we continue this process until all rows in our
- three-dimensional grid are transformed, we will create
- a new grid with the following definition:
- 0 1 2 3 4
- uoAIOaUEei OIUeiuoaAE eaiuAIEoOU EAIUaieOou UOaioAueEI
- oiuEIUOAae IEOaeoiUuA aUeouEAiIO AuEOUeaIio OIUeiuoaAE
- EAIUaieOou aUeouEAiIO oiuEIUOAae OIUeiuoaAE eaiuAIEoOU
- eaiuAIEoOU AuEOUeaIio OIUeiuoaAE oiuEIUOAae EAIUaieOou
- OIUeiuoaAE ieoAEOIuUa AuEOUeaIio aUeouEAiIO oiuEIUOAae
- aUeouEAiIO uoAIOaUEei IEOaeoiUuA ieoAEOIuUa AuEOUeaIio
- IEOaeoiUuA eaiuAIEoOU uoAIOaUEei UOaioAueEI ieoAEOIuUa
- UOaioAueEI oiuEIUOAae EAIUaieOou eaiuAIEoOU uoAIOaUEei
- ieoAEOIuUa EAIUaieOou UOaioAueEI uoAIOaUEei IEOaeoiUuA
- AuEOUeaIio UOaioAueEI ieoAEOIuUa IEOaeoiUuA aUeouEAiIO
- 5 6 7 8 9
- AuEOUeaIio ieoAEOIuUa aUeouEAiIO oiuEIUOAae IEOaeoiUuA
- uoAIOaUEei eaiuAIEoOU UOaioAueEI ieoAEOIuUa EAIUaieOou
- IEOaeoiUuA uoAIOaUEei ieoAEOIuUa AuEOUeaIio UOaioAueEI
- ieoAEOIuUa UOaioAueEI IEOaeoiUuA aUeouEAiIO uoAIOaUEei
- UOaioAueEI EAIUaieOou uoAIOaUEei IEOaeoiUuA eaiuAIEoOU
- eaiuAIEoOU OIUeiuoaAE EAIUaieOou UOaioAueEI oiuEIUOAae
- OIUeiuoaAE AuEOUeaIio oiuEIUOAae EAIUaieOou aUeouEAiIO
- aUeouEAiIO IEOaeoiUuA AuEOUeaIio OIUeiuoaAE ieoAEOIuUa
- oiuEIUOAae aUeouEAiIO OIUeiuoaAE eaiuAIEoOU AuEOUeaIio
- EAIUaieOou oiuEIUOAae eaiuAIEoOU uoAIOaUEei OIUeiuoaAE
- This is the same three-dimensional grid created up in
- the "make encoding grid" phase, but each row has had
- the previously defined transformation run on it. The
- characters at (0,0,X) are the same "uoAIOaUEei" that we
- found before. This new three-dimensional grid can now
- be used to decrypt our ciphertext back into plaintext.
- Decrypt
- -------
- Just as with encrypting, we need to form a coordinate
- with which to reference our three-dimensional grid. We
- take our primer again which primes the process and
- generate the coordinate (E,U,_). The last position will
- be the first character of interest in our ciphertext.
- In this case, "e" will replace the underscore to
- produce (E,U,e).
- Again, this character based coordinate needs to have
- the vowels replaced with numbers. We reference the base
- (the sorted one-dimensional template used previously)
- and determine that the coordinate should be (1,4,6).
- Not surprisingly, we discover this position in our
- decoding grid to be "I" which is the first letter in
- the word "In."
- We may pass over the characters "n th" as we did when
- encrypting since they are uninteresting to us. Now we
- need to decode the "A" following the "th." The
- character coordinate needs to be modified such that the
- "e" is replaced with "I" since that is its decoded
- value to become (E,U,I). Next, the "A" should be
- appended and the "E" dropped to maintain our three
- dimensions.
- With the coordinate now reading as (U,I,A), we may now
- transform those vowels into the index positions from
- our base. From there, we get the coordinate (4,2,0).
- When we use this to access the characters in our
- decoding grid, we find the letter "e" so that "thA"
- becomes "the" as expected. Our next coordinate will
- become (I,e,o) with a numerical value of (2,6,8).
- All transformations will be listed as was done for the
- encryption section. Do not forget that the last decoded
- letter will replace its position in the coordinate
- before the next letter is appended and the first letter
- dropped. This will allow a consistency that will
- allowed continued decryption. The following log's
- format is ciphertext character -> character coordinate
- -> index coordinate -> plaintext character.
- e -> (E,U,e) -> (1,4,6) -> I
- A -> (U,I,A) -> (4,2,0) -> e
- o -> (I,e,o) -> (2,6,8) -> e
- o -> (e,e,o) -> (6,6,8) -> i
- e -> (e,i,e) -> (6,7,6) -> i
- u -> (i,i,u) -> (7,7,9) -> o
- O -> (i,o,O) -> (7,8,3) -> e
- U -> (o,e,U) -> (8,6,4) -> a
- O -> (e,a,O) -> (6,5,3) -> e
- O -> (a,e,O) -> (5,6,3) -> e
- a -> (e,e,a) -> (6,6,5) -> e
- e -> (e,e,e) -> (6,6,6) -> a
- O -> (e,a,O) -> (6,5,3) -> e
- i -> (a,e,i) -> (5,6,7) -> a
- O -> (e,a,O) -> (6,5,3) -> e
- O -> (a,e,O) -> (5,6,3) -> e
- e -> (e,e,e) -> (6,6,6) -> a
- While the process does not require a computer, using
- one to automate this process can be very helpful.
- Another problem one might encounter is the space
- requirements required by the grid constructed from a
- large key. Grids take up space equivalent to A raised
- to the power of B where A is the count of unique
- characters to encrypt and B is the length of the Markov
- chain used to index the grid.
- As a result, taking the transformations of the key into
- a grid should be redesigned so that the encoding and
- decoding grids are not needed at all. Otherwise if you
- had 100 characters of interest and wanted to use Markov
- chains of length 10 (requiring a primer of length 9),
- you would need to construct a grid having over 86
- Exabytes of data. The final result of our decryption is
- as follows:
- In the beginning God created the heaven and the earth.
- Conclusion
- ----------
- While this tutorial covered the first plaintext and
- ciphertext pair, the second is left as an exercise for
- the reader. This tutorial may also be considered to be
- a work in progress. If you can improve it, please do so
- and pass it on to the rest of your team. Though it
- would probably be difficult to discover the results,
- finding out how Merlin would respond to this would be
- particularly interesting to me.
- A Concerned Individual,
- Velociraptor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement