Before i say something i want you to know that my english isn't perfect. I looked for help on polish forums, but in the end no one cared enough to help me.
Few days ago my programing teacher in school gave me a homework. My job was to make a program that can encipher text, but in order to get the highest grade it cant be something simple like a ceaser shift or Visionere(im pretty sure i spelled it wrong).
I didn't know much about cryptology so I watched some videos about enigma, and created a program that works like it. Actually it doesn't at all, all these two have in common are 3 rotors, and thats it. But i have encountered few problems with it. But before i talk about it I will try to explain how it works. Once again i remind you that my english is not perfect.
So what happens first is you have to set 3 rotors, each rotor have 27 positions(0-26), and each position has assaigned a value (1-27), every value is unique, and there is no 2 positions with the same value assigned.
After you set 3 rotors, you have to remember their positions, beacuse you will need them to decipher the message.
Lets say you set rotors to (0 0 0) and want to encipher the word (abcde). What will happen first is that each letter will become a number (a=1 b=2 c=3 etc).
All values from rotors will be added together, values for rotors set on (0 0 0) look, like this (10 3 1). These will be added together so, 10+3+1=14. And this will be added to the first letter that was turned into number so. 1 + 14 = 15. Now 15 will turn into a letter (1=a 2=b etc.).
But before B is enciphered the first rotor will go from 0 to 1. so the rotors will be set like this (1 0 0) and the values will look like so (3 3 1). And the letter is going to be enciphered the same way buy instead of adding 14 to the letter it will add 7.
When the rotors get to (26 0 0) next they will go to (0 1 0) and then (1 1 0) (2 1 0) etc.
Deciphering works the same way but instead of adding the values it subtracts them.
I'm sure this explanation looks to you like written by 8 years old kid, but
"i cant english very well" if you speak polish i can explain it much better.
Few aditional information:
-It can encipher 26 letters and space.
-Letter after enciphering can become itself
-Letter after enciphering can become a space
-Space after enciphering can become a space, and a letter.
-All other symbols are treated like spaces, and they will be deciphered into spaces.
So it pretty much works like Visioner and ceaser shift, but thanks to rotors program can encipher 19 683 letters uniqly.
But the problem is... it doesn't. My teacher didn't notice it and i got the highest grade but its still bugging me. I checked the code many times, and every time, every part of the code worked fine, but still it doesn't encipher text they way i want.
Now i will explain what the problem is.
Lets try to encipher letter "a" 4000 times with the rotors set on
(0 0 0). The result looks like this.
Quote:
| ohlmrusfy jwpagdctbvzxinkqpzswxbecqikug lrondmfjhtyvakunrsx yldfpbvgmjizhaecotqwhrkopuxviacmzsdjgfweyb lqntnxquv caogiseyjpmlbkdhfrwtztcw afigumoykdpvsrhqjnlxbzerauyzdgeskmwibntqpfohljv xcjtmqrwzxkceoauflihyg dbnspvveybchkiwoq mfrxutjslpnzdaggqjnotwuh blyrcifevdxazkpmszibfglom sudqjvayxnwptrchekxg dejmkyqsbohtzwvlunrpafciakdhinqobuwfslxc zpyrvtejgm jcghmpnatverkwbzyoxqusdiflwfzcdiljxprangsyvuktmqo ebhmwptuzb nfhrdxiolkajcgeqvsyyhaefknlzrtcpiu xwmvosqbgdjudxabgjhvnpzleqwtsirkomyc fq txycfdrjlvhamspoengkiuzwbsbvz ehftlnxjcourqgpimkwaydcmfjkpsqdwyhunzebar txvglioislpqvywjbdn tekhgxfzcamroulvostyazmegqcwhnkj ibfdpurxdngklqtrexzivo fcbsauywhmjpfpimnsvtgzakxqbheducw yjolroyrvwadbphjtfzkqnmcleigsxu bleijorpcvxgtmyda qzswufkhntcw afigumoykdpvsrhqjnlxbzedngklqtrexzivo fcbsauywhmjpzibfglom sudqjvayxnwptrchekwfzcdiljxprangsyvuktmqo ebhbleijorpcvxgtmyda qzswufkhnhrkopuxviacmzsdjgfweyb lqntfpimnsvtgzakxqbheducw yjolryhaefknlzrtcpiu xwmvosqbgdjjtmqrwzxkceoauflihyg dbnspvveybchkiwoq mfrxutjslpnzdagnxquv caogiseyjpmlbkdhfrwtzlvostyazmegqcwhnkj ibfdpurxpzswxbecqikug lrondmfjhtyvaoyrvwadbphjtfzkqnmcleigsxu kunrsx yldfpbvgmjizhaecotqwakdhinqobuwfslxc zpyrvtejgmmwptuzb nfhrdxiolkajcgeqvsyislpqvywjbdn tekhgxfzcamroueohlmrusfy jwpagdctbvzxinkqgqjnotwuh blyrcifevdxazkpmsrauyzdgeskmwibntqpfohljv xcxg dejmkyqsbohtzwvlunrpafci jcghmpnatverkwbzyoxqusdiflsbvz ehftlnxjcourqgpimkwaydudxabgjhvnpzleqwtsirkomyc fcmfjkpsqdwyhunzebar txvglioq txycfdrjlvhamspoengkiuzwblvostyazmegqcwhnkj ibfdpurxwfzcdiljxprangsyvuktmqo ebhrauyzdgeskmwibntqpfohljv xcoyrvwadbphjtfzkqnmcleigsxu udxabgjhvnpzleqwtsirkomyc f jcghmpnatverkwbzyoxqusdiflyhaefknlzrtcpiu xwmvosqbgdjq txycfdrjlvhamspoengkiuzwbbleijorpcvxgtmyda qzswufkhnnxquv caogiseyjpmlbkdhfrwtzfpimnsvtgzakxqbheducw yjolrdngklqtrexzivo fcbsauywhmjphrkopuxviacmzsdjgfweyb lqntgqjnotwuh blyrcifevdxazkpmscmfjkpsqdwyhunzebar txvgliotcw afigumoykdpvsrhqjnlxbzeeohlmrusfy jwpagdctbvzxinkqakdhinqobuwfslxc zpyrvtejgmxg dejmkyqsbohtzwvlunrpafcizibfglom sudqjvayxnwptrchekjtmqrwzxkceoauflihyg dbnspvpzswxbecqikug lrondmfjhtyvasbvz ehftlnxjcourqgpimkwaydkunrsx yldfpbvgmjizhaecotqwmwptuzb nfhrdxiolkajcgeqvsyveybchkiwoq mfrxutjslpnzdagislpqvywjbdn tekhgxfzcamroufpimnsvtgzakxqbheducw yjolrq txycfdrjlvhamspoengkiuzwblvostyazmegqcwhnkj ibfdpurxislpqvywjbdn tekhgxfzcamrouoyrvwadbphjtfzkqnmcleigsxu udxabgjhvnpzleqwtsirkomyc fsbvz ehftlnxjcourqgpimkwaydkunrsx yldfpbvgmjizhaecotqwwfzcdiljxprangsyvuktmqo ebhhrkopuxviacmzsdjgfweyb lqnt jcghmpnatverkwbzyoxqusdiflyhaefknlzrtcpiu xwmvosqbgdjbleijorpcvxgtmyda qzswufkhnakdhinqobuwfslxc zpyrvtejgmxg dejmkyqsbohtzwvlunrpafcinxquv caogiseyjpmlbkdhfrwtzzibfglom sudqjvayxnwptrchekveybchkiwoq mfrxutjslpnzdagrauyzdgeskmwibntqpfohljv xctcw afigumoykdpvsrhqjnlxbzedngklqtrexzivo fcbsauywhmjpjtmqrwzxkceoauflihyg dbnspvmwptuzb nfhrdxiolkajcgeqvsyeohlmrusfy jwpagdctbvzxinkqgqjnotwuh blyrcifevdxazkpmspzswxbecqikug lrondmfjhtyvacmfjkpsqdwyhunzebar txvgliosbvz ehftlnxjcourqgpimkwaydcmfjkpsqdwyhunzebar txvglioyhaefknlzrtcpiu xwmvosqbgdjveybchkiwoq mfrxutjslpnzdagakdhinqobuwfslxc zpyrvtejgmgqjnotwuh blyrcifevdxazkpmseohlmrusfy jwpagdctbvzxinkqxg dejmkyqsbohtzwvlunrpafciislpqvywjbdn tekhgxfzcamrouudxabgjhvnpzleqwtsirkomyc fmwptuzb nfhrdxiolkajcgeqvsykunrsx yldfpbvgmjizhaecotqwoyrvwadbphjtfzkqnmcleigsxu nxquv caogiseyjpmlbkdhfrwtzjtmqrwzxkceoauflihyg dbnspv jcghmpnatverkwbzyoxqusdifllvostyazmegqcwhnkj ibfdpurxhrkopuxviacmzsdjgfweyb lqntdngklqtrexzivo fcbsauywhmjpfpimnsvtgzakxqbheducw yjolrq txycfdrjlvhamspoengkiuzwbwfzcdiljxprangsyvuktmqo ebhzibfglom sudqjvayxnwptrchekrauyzdgeskmwibntqpfohljv xctcw afigumoykdpvsrhqjnlxbzebleijorpcvxgtmyda qzswufkhnpzswxbecqikug lrondmfjhtyvaq txycfdrjlvhamspoengkiuzwbakdhinqobuwfslxc zpyrvtejgmwfzcdiljxprangsyvuktmqo ebhtcw afigumoykdpvsrhqjnlxbzezibfglom sudqjvayxnwptrchekeohlmrusfy jwpagdctbvzxinkqcmfjkpsqdwyhunzebar txvglioveybchkiwoq mfrxutjslpnzdaggqjnotwuh blyrcifevdxazkpmssbvz ehftlnxjcourqgpimkwaydkunrsx yldfpbvgmjizhaecotqwislpqvywjbdn tekhgxfzcamroumwptuzb nfhrdxiolkajcgeqvsylvostx |
Well, it looks like someone tried to type something with their forehead. At first, it looks perfect. 4000 letters a, was enciphered into something completly different and it doesn't look like the cipher is repeating. The problem is, the whole cypher is not repeating but parts of it are. It doesnt make any sense to me. Copy it to notepad and search for "ohlmrusfy" (first 9 letters) They repeat like 8 times, but surrounded by different letters and in random intervals. Same thing goes to other parts of the cipher. I'm clueless. Once again, my code is fine. My math seem to be wrong, but i dont know where im wrong.
I tried to add more rotors but it only makes the repetition to appear even more frequently. I would love to give you my code and program, but they are in polish.
And also, im just curious, how good is my program, how hard it would be to break?
Also, i cant speak very well in english but i understund everything. So feel free to write complicated explanations.
@edit
I found this forum simply by searching "Cryptology forum", but now after reading few other threads in here I feel like this may not be the best place to to post this thread. You guys seem to be discussing stuff that is way more advanced than this. But please if you have some spare time, help me with this problem.