1
$\begingroup$

I have a known input and a known output but how would I go about working out what the cipher was used. Below are a few examples of input and output.

On the last one I noticed a repeating pattern. Would that point me in a particular direction?

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Might be vigenere $\endgroup$ – cisnjxqu Dec 11 '20 at 16:00
1
$\begingroup$

Block size 8 symbols because repetitions. it is not caesar or vigenere because next symbol (B instead of A) in input doesnt mean next symbol in output(j instead of i). It is primitive cipher because 1 letter input makes 1 letter output. Closest thing is likely enigma, the world war 2 cipher machine. To decode think about it as 8 substitute ciphers. Symbol in positions 1+8n, where n=0,1,2,3,4... uses first substitution cipher. symbol in position 2+8n, where n=0,1,2,3,4... uses second substitution cipher.

How to test if im right: enter BA in input. Output will be Di.

How to recreate it: write down substitution alphabet for symbol 1 by entering in input A, then B, then C... and writing down the output. You will get a table that says 'if A then X'. Repeat for the second position, it will give you second substitution alphabet. In total you will get 8 substitution alphabets. Then you can turn letters into numbers. Im almost certain that author was lazy enough to code this substitution with math, and not actual alphabets. Seeing letters in substitution alphabets in a form of numbers you can make equations. A=1, B=2, C=3, ... X=26, A multiply 5+21=X, 1 multiply 5+21=26. Once you figured out the math for each symbol position, you can figure out math for going from symbol 1 to symbol 2, likely the same operation as converting a symbol from input to output. At this point you will have a compact representation of author's algorithm.

$\endgroup$
1
  • $\begingroup$ It was Di - thank you $\endgroup$ – pee2pee Dec 17 '20 at 10:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.