In deciding a plagiarism case against author Dan Brown1 in April 2006, British justice Peter Smith2 handed down a peculiar judgment3. Certain letters in the text had been italicized with no explanation. Apparently inspired by Brown's book The Da Vinci Code4, Smith had hidden a message in the text as hinted by this sentence

The key to solving the conundrum posed by this judgment is in reading HBHG and DVC.

In context, Smith used those abbreviations throughout his judgement to refer to The Holy Blood and the Holy Grail5 (1982), the book that Brown had been accused of plagiarizing, and Brown's own book The Da Vinci Code (2005). In handing down the opinion — which found Brown not guilty — Smith publicly admitted that

I can't discuss the judgement, but I don't see why a judgement should not be a matter of fun.

He promised to confirm any correct solution. It was first broken6, in the same month, by Dan Tench — a lawyer who writes on media issues for The Guardian — after he received a series of email clues about it from justice Smith. From an article 'Da Vinci' judgement code puzzles lawyers by Derek Kravitz in the Seattle Post-Intelligencer:

The New York Times reported7 that Smith sent an e-mail to a reporter at the newspaper that offered a hint. It said the code referred to his entry in this year's edition of Britain's "Who's Who," which has references to his wife Diane, his three children Frazier, Parker, and Bailey, British naval officer Jackie Fisher, and the Titanic Historical Society – among other things.

The Court of Appeal later said that Smith

… was prompted by the extensive use in [The Da Vinci Code] of codes, and no doubt by his own interest in such things, to incorporate a coded message in his judgment, on which nothing turns. The judgment is not easy to read or to understand. It might have been preferable for him to have allowed himself more time for the preparation, checking and revision of the judgment.

Assignment

We give you a text file containing justice Smith's judgment, with italicized fragments enclosed between consecutive asterisks (*). An italic fragment may consist of multiple characters, but always begins and ends on the same line (i.e., never runs across multiple lines and does not contain newlines). The same line may contain multiple italic fragments.

The entire judgment covers 360 sections. If we only keep words with italicized fragments from the original judgment, we get (italicized fragments highlighted in yellow)

Claimant*s* clai*m*ant *i*s *t*hat *h*is realit*y* *c*ynicism f*o*r prece*d*ed T*e*mplar
    
*J*ersey *a*ble res*e*arch th*i*s techniqu*e*s e*x*tinguished *t*echnical st*o*ry wa*s*
*t*he somethin*g* grou*p*s u*s*ed w*a*s do*c*uments bein*g* e*r*adicated elsewh*e*re
Templ*a*rs Clai*m*ants se*q*uence *w*ith o*f* *k*ey Plant*a*rd intro*d*uced manuscri*p*ts
ulti*m*ately *q*uestions embla*z*oned pre*v*alent

Concatenating all these italicized fragments yields

smithycodeJaeiextostgpsacgreamqwfkadpmqzv

The first ten letters (from sections 1–79) are the plaintext name of the cipher: the Smithy code. The remaining letters (from sections 8–4310) are a ciphertext encrypted with key AAYCEHMU. This key corresponds to the Fibonacci sequence11 1, 1, 2, 3, 5, 8, 13, 21 if letters are associated with their position in the alphabet (A=1, C=3, E=5, H=8, M=13, U=21). Only the letter Y seems a bit out of place. However, that's a twist drawn from the book The Holy Blood and the Holy Grail to denote a backward step of 2 rather than a forward step. Counting two letters backward in the regular alphabet yields the letter Y.

We explain how the Smithy code works using the plaintext

Jackie Fisher who are you? Dreadnought.

During encryption, all characters that are not letters simply remain in place. Uppercase letters are encrypted as uppercase letters, and lowercase letters as lowercase letters. Letters correspond to their position in the alphabet, but this time we start counting from zero (A=0, B=1, C=2, …, Z=25). If $$p_i$$ is the value of the $$i$$-the letter in the plaintext and $$k_i$$ is the value of the $$i$$-the letter in the key (with the last letter of the key followed by the first letter), then the $$i$$-the letter of the ciphertext has a value $$c_i$$ which is computed as \[ c_i = (p_i - k_i)\ \mathrm{mod}\ 26 \] where $$a\ \mathrm{mod}\ b$$ denotes the remainder after integer division (quotient) of $$a \in \mathbb{N}$$ by $$b \in \mathbb{N}_0$$ (modulo12). The encryption of the plaintext can thus be represented as

 plaintext: Jackie Fisher who are you? Dreadnought.
            ------|------|---|---|---||-----------|
       key: AAYCEH|MUAAYC|EHM|UAA|YCE||HMUAAYCEHMU|
            ======↓======↓===↓===↓===↓↓===========↓
ciphertext: Jaeiex Toshgp sac gre amq? Wfkadpmqzvz.

During decryption, the $$i$$-the letter of the plaintext is determined as the letter with value $$p_i$$ which is computed as \[ p_i = (c_i + k_i)\ \mathrm{mod}\ 26 \] The decryption of the ciphertext can thus be represented as

ciphertext: Jaeiex Toshgp sac gre amq? Wfkadpmqzvz.
            ++++++|++++++|+++|+++|+++||+++++++++++|
       key: AAYCEH|MUAAYC|EHM|UAA|YCE||HMUAAYCEHMU|
            ======↓======↓===↓===↓===↓↓===========↓
 plaintext: Jackie Fisher who are you? Dreadnought.

Note that justice Smith made two mistakes in compiling the ciphertext hidden in his judgement. The tenth letter of the ciphertext should have been a t instead of an h, and there should have been an additional z at the end of the ciphertext.

Your task:

Example

In the following interactive session, we assume the current directory contains the text files document.01.txt13, document.02.txt14 and document.03.txt15.

>>> encrypt('Jackie Fister who are you? Dreadnough.', 'AAYCEHMU')
'Jaeiex Tostgp sac gre amq? Wfkadpmqzv.'
>>> encrypt('Jackie Fisher who are you? Dreadnought.', 'AAYCEHMU')
'Jaeiex Toshgp sac gre amq? Wfkadpmqzvz.'

>>> decrypt('Jaeiex Tostgp sac gre amq? Wfkadpmqzv.', 'AAYCEHMU')
'Jackie Fister who are you? Dreadnough.'
>>> decrypt('Jaeiex Toshgp sac gre amq? Wfkadpmqzvz.', 'AAYCEHMU')
'Jackie Fisher who are you? Dreadnought.'

>>> italic('Claimant*s* clai*m*ant *i*s *t*hat *h*is realit*y* cynicism f*o*r prece*d*ed T*e*mplar')
'smithyode'
>>> italic('*J*ersey *a*ble res*e*arch th*i*s techniqu*e*s e*x*tinguished *t*echnical st*o*ry wa*s*')
'Jaeiextos'
>>> italic('*t*he somethin*g* grou*p*s u*s*ed w*a*s do*c*uments bein*g* e*r*adicated elsewh*e*re')
'tgpsacgre'
>>> italic('Templ*a*rs Clai*m*ants se*q*uence *w*ith o*f* *k*ey Plant*a*rd intro*d*uced manuscri*p*ts')
'amqwfkadp'
>>> italic('ulti*m*ately *q*uestions embla*z*oned pre*v*alent')
'mqzv'

>>> smithy('document.01.txt16')
'smithycode'
>>> smithy('document.02.txt17')
'Jaeiextostgpsacgreamqwfkadpmqzv'
>>> smithy('document.02.txt18', 'AAYCEHMU')
'Jackiefisterwhoareyoudreadnough'
>>> smithy('document.03.txt19')
'Jaeiextostgpsacgreamqwfkadpmqzv'
>>> smithy('document.03.txt20', 'AAYCEHMU')
'Jackiefisterwhoareyoudreadnough'

Epilogue

John Arbuthnot "Jacky" Fisher was a British admiral whom Smith admired.

John Arbuthnot "Jacky" Fisher
Admiral of the Fleet John Arbuthnot "Jacky" Fisher, 1st Lord Fisher of Kilverstone, was a driving force behind the development of the fast, all-big-gun battleship, and chaired the Committee on Designs which produced the outline design for the first modern battleship, HMS Dreadnought21.

He was a driving force behind the development of the fast, all-big-gun battleship, and chaired the Committee on Designs which produced the outline design for the first modern battleship, HMS Dreadnought22.

Epilogue

In keeping with the theme of this assignment, we have also hidden a secret message in its description. Click here to visualize the message.