# Help a woman from ancient Rome find out how her husband is doing

Let's go back 2000 years. A woman named Valeria received a strange message from her husband Claudius who is a frumentarius.

The message:

DXZDBL YPYELI CNVI VR DJMBTV ZOQFV.
DQUCWCE DCJZEK UKP WEDHES,
L ZUWSCE TD RA YP TYFUK ED BT BC EXIG.
WKK MXC VD AJZJ.


Valeria knows her husband is a quirky one and won't use a fixed shift cipher, but can't figure out the formula used for the shift. The message doesn't have a key either.

Help Valeria understand what's happening to her husband.

• The message doesn't appear to have a key either. Can you elaborate on this? Does this mean that 1. The encoding system doesn't use a key, 2. simply that Valeria could not find a key to go along with the message, or 3. that there is a key, since it says 'doesn't appear to have a key'? Jul 23, 2023 at 17:12
• @newQOpenWid - there is no key, thank you for asking to clarify this ambiguity. I have edited the post appropriately. Jul 23, 2023 at 17:55
• I don't know, seeing the letters JUW strains my belief that the message was written two thousand years ago :P Jul 31, 2023 at 12:25
• @codewarrior0 - our time machine's onboard AI had to accommodate the message for our modern alphabet. No, the AI won't tell us what the message is :D Jul 31, 2023 at 19:15

# Plaintext

AUTUMN LEAVES FALL ON SUMMER GRASS.
ANOTHER SEASON HAS PASSED,
I WONDER IF IT IS GOING TO BE MY LAST.
THE DIE IS CAST.

# Cipher Method

A Vigenere-type shift cipher where the shift for each letter is the sum of the shifts of the two previous letters. The two initial shifts are both 3. The sequence restarts at the beginning of each line. Reminiscent of the Fibonacci sequence, and also called a "recurrence relation", it is similar to early prototypes of stream ciphers built around shift registers. In fact, the keying sequence is exactly equal to the result of multiplying each element of the Fibonacci sequence by 3, and taking the remainder modulo 26. (Taking the remainder causes the sequence to repeat itself after 84 elements.)

# Solve Path

Using the Index of Coincidence to test the cipher for periodicity turned up a strong result of about 4.1 for a period of 50. I found this unbelievable since the cipher's length is only 91, but since the expected result for two texts in depth (that is, aligned with respect to the key) is only 1.6, I forged ahead anyway. I used Guballa's Vigenere solver, told it the key size was 50, and got absolute nonsense:

ETERST HETONP ERER ER EINTON EOTOT.
ANOTHEB ETHENT HER ETHENT,
H EINALT ON TH AT CHOUL DE TO TH EARE.
THE DIE SE RHES.

The final line reminded me of a famous quote from Classical times: "The Die Is Cast", originally alea iacta est. I assumed those words were the final line of the text and recovered the resulting Vigenere key DDGJPYNLYJHQ, which I dragged across the entire text. When the key was placed at the beginning of each line, words appeared.

DXZDBL YPYELI
autumn leaves

DQUCWCE DCJZE
another seaso

L ZUWSCE TD RA
i wonder if it

I could have competed the solve from here by assuming one word at a time in any of the three lines, checking the word against the other two and slowly building up the key. Because the puzzle mentions a "formula used for the shift", I looked closely at the key fragment instead. It begins 'DDGJP', which when converted to numbers using A=0 and Z=25, gives the sequence 3, 3, 6, 9, 15, which I noticed is kind of like the Fibonacci sequence. Completing the sequence modulo 26 yielded the complete plaintext.

The equivalent Vigenere key for this sequence is 84 letters long. Because the cipher restarts the key from the beginning after each line, the resulting text is aperiodic and standard Vigenere autosolvers are prevented from solving it. The equivalent key:

DDGJPYNLYJHQXNKXHELPAPPETXQNDQTJCLNYLJUDXAXXURLCNPCRTKDNQDTWPLALLWHDKNXKHRYPNCPRGXDA

This key also has an interesting phenomenon. If the key is broken into 21-letter chunks, each chunk has the same pattern of repeated letters: They all start with a double letter, they all have the letters N and A in the same places, and (for example) every case of the letter P in the first line corresponds to a letter X in the second line. This phenomenon is what cryptologists used to call Isomorphism.

DDGJPYNLYJHQXNKXHELPA
PPETXQNDQTJCLNYLJUDXA
XXURLCNPCRTKDNQDTWPLA
LLWHDKNXKHRYPNCPRGXDA

• Surely this can't be correct. Claudius would've written in Latin, not in English. (j/k) Aug 24, 2023 at 9:53
• Well done! Great solution, thank you. As for Claudius's fate, I'll let everyone draw their own conclusions :) Aug 24, 2023 at 14:32