Search code examples
pythonalgorithmencryptioncaesar-cipher

How to figure out the cypher knowing some inputs and outputs


So I found a little problem on the Internet:

given only 3 inputs and corresponding outputs, one need to figure out the cypher or the encoding algorithm that was used. The inputs/outputs are:

"get" -> "2069"
"more" -> "5191716"
"insight" -> "209912231915"

I tried something like A1Z26, converting this to binary and trying to add/multiply/concatenate and so on the numbers, looking at the factors of those numbers, but could not find anything that works... Any help would be appreciated!


Solution

  • Makes some sense if string is read from right to left. For instance, take "get". Let's read it right to left as "teg". Code each letter based on alphabetic order(a=1, b=2, and so on). T=20 E=5 G=7. Add 0 to first character, 1 to second, 2 to third. You get 20 6 9. Same holds for the rest