Advertisement
thinkingObserver

Liber Primus Vigenère solver

Mar 3rd, 2017
466
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1. Liber Primus Vigenère solver
  2.  
  3.  
  4. Dictionary made out of en wikipedia dump.
  5. https://dumps.wikimedia.org/backup-index.html
  6.  
  7. Anglo-Saxon Runes vigenère solver.
  8. Rotates each character, in the cipher text, according to a recursive key of n-length. Either encoded in rotation numbers or runes, the first key digit in the alphabet, 0 or ᚠ (F) is neutral, it does not rotate the cipher text.
  9. If numbers are used, their value may be bigger than the number of characters in the alphabet. r%29 is equal to the proper rotation, where r is the arbitrarily big rotation number. It should always be used as a test. 0 is equivalent to the first rune, ᚠ (F), and 28 is equivalent to the last rune, ᛠ (EA). 29 rotation is equal to 0.
  10. This function or method would take a string of runes and a list of rotation numbers or runes and output runes.
  11.  
  12. Rune to rotation number converter.
  13.  
  14. Rotation number to rune converter.
  15.  
  16. Latin to Anglo-Saxon Runes converter.
  17. Converts strings in the latin alphabet into runes. Some groups of latin characters convert to single runes. "ING" is the largest sequence of such a nature, and the only one with three characters. We also have sequences of two characters that represent a single rune, which includes the same rune as for "ING", but in the form of "NG", as well as "TH", "EO", "OE", "AE", "EA", and "IA" or "IO". The last two represent the same rune. Any single character is converted to its respective rune.
  18. Every latin sequence identified is replaced by the respective rune.
  19. The process has three stages that must be carried out in the following order. Checking for latin groups of three, followed by checking for latin groups of two, followed by checking for single latin characters.
  20. The input, being a string of latin text, can be handled intermediately as a list of separated latin and rune text, with items containing only latin or rune characters, in their respective order. Spaces can have their own item.
  21. First arrived first served.
  22. The result should be a single Anglo-Saxon Rune string.
  23.  
  24. Anglo-Saxon Rune to Latin converter.
  25. This one is direct, and will be done in one fell swoop. Except for the fact that there are ambiguous runes, which can convert to more than one character. I would suggest including these in parenthesis, and both possibilities inside, separated by a comma.
  26.  
  27. Latin ambiguity correction.
  28. Takes a string of latin characters which include ambiguity in having converted from runes, and checks the possible words that result with a dictionary. If no matches are found, or more than one or all matches are found, all the possible words are to be included in parenthesis separated by commas.
  29.  
  30. Anglo-Saxon Runic English Dictionary.
  31. The dictionary derived from the en wikipedia dump should be converted into runes in its entirety. It is convenient to have the dictionary sorted and divided by number of characters.
  32.  
  33. Runic Ciphertext length count.
  34. The length of each word in a page is to be counted and put into a list of such integers.
  35.  
  36. Runic Ciphertext word Runic Dictionary word difference.
  37. A random word in the page is chosen. Of its length, a random word in the dictionary is chosen. The latter is subtracted from the former, thus yielding an assumed cipherkey. This key is what added to the word in the primus will result in the word in the dictionary.
  38. Randomness can be substituted for some more efficient processes, possibly choosing the lengthiest word in the page, and using a version of the dictionary sorted by frequency of use.
  39.  
  40. Runic Dictionary checker.
  41. Similar to the latin ambiguity correction, this will check to see if a runic word is represented in the dictionary. Sections of words could also be checked in their original length category.
  42. An example in latin for this would be the word "liber":
  43. [l,i,b,e,r, li,ib,be,er, lib,ibe,ber, libe,iber, liber]
  44. Each of those items would be checked against words of length five starting on their proper index position.
  45.  
  46. Runic Ciphertext Runic Key application.
  47. The key of the difference will be applied recursively to the rest of the page, respecting the position from which it originated. The runic dictionary checker is to be used, and the percentage of text matched is to be recorded as a benchmark.
  48. Still within the instance of the same key, after the whole page was checked and benchmarked, the key should be added one unit of length and contain a neutral rotation, 0 or ᚠ (F). As an example in latin, the key "primus" would now become "primusa". This is when the sections of words setting in the runic dictionary checker becomes useful. The addition of length will repeat.
  49.  
  50. After a key is checked to its limit, the solver should choose another dictionary word to subtract from the same word first chosen off the page.
  51. The results will all be sorted according to the benchmark that relates to the accuracy of translation. A standard could be used to avoid unnecessary information being stored, like 50% accuracy, or more.
  52. It's probable that if no attempt for the first word picked off the page led to a satisfactory outcome, then no other word in the page being ran through this process will. Although, it probably should be tried.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement