Home > Warhammer Fantasy > Code of Vengeance

Code of Vengeance

I’ve been promising to blog about this for a while, and have finally found some time to do it. As readers of Sword of Vengeance will know, there’s a passage in the book where Schwarzhelm comes into possession of a coded letter written by his old master Lassus, which he then works to decipher.

In the original draft of the novel, the contents of the letter were reported by Schwarzhelm’s aide, Pieter Verstohlen. After reading the draft, my editor Lindsey Priestley had the bright idea of generating a real code that could be solved by the reader. I was a bit daunted by this idea for a while. The more I thought about it, though, the more I liked it, and so I started to do some research.

I didn’t know much about historical ciphers, so had to read around for a bit. Warhammer Fantasy is set in a roughly renaissance-era mythical Europe, and the military forces of the Empire operate like 16-17th century Germans. That placed a few constraints on what I could come up with. The code couldn’t be too complicated, since time and resources on a battlefield are limited, and also because the vast majority of the Empire’s population are illiterate anyway. And it would need to be solvable using quill and parchment – no Enigma machines necessary.

The simplest code type is a substitution cipher. This involves swapping letters in the plaintext (the text that needs decoding) with replacements to create a jumbled mess, called ciphertext. So, for example, a very basic code would involve shifting every letter three places to the right in an alphabetical sequence (so an ‘a’ becomes a ‘d’, a ‘b’ becomes an ‘e’, and so on):

Plaintext:  Kill them all!
Ciphertext: Nloo wkhp doo!

Not very difficult to decipher! I wanted something slightly more challenging. Tougher substitution schemes, such as the one invented by Giovan Battista Bellaso in the 16th century, use a key – a short word – to add some complexity. This kind of cipher is more commonly known as a Vigeniere cipher, which is what I based Lassus’s code on in the book (Verstohlen calls it a ‘Vignius’ cipher in his letter in the epilogue).

The idea here is that instead of shifting, say, three places every time, the decoder has to shift by a different amount every time he decodes a letter in the ciphertext. The amount he has to shift by is given to him by using the key. If you have the key, then decoding the ciphertext is relatively easy. If you don’t have it, then it’s very difficult.

To see how this works, we need to use an alphabet table like the one on the right. Suppose I use a key of ‘Altdorf’, and I want to decode the instruction ‘Kill them all!’. I start with the first letter of the key, ‘a’. This gives me the row that I need to use in the alphabet table. Then I find the column headed by the first letter of the plaintext (‘k’). Where the column and the row meet gives me the first letter of the ciphertext: ‘k’. You then repeat this process with the second letter of the key (row ‘l’) and the second letter of the plaintext (column ‘i’), which gives ‘t’. Once you run out of letters in the key, then you just loop round and start again.

Here’s how the whole thing translates (with spaces removed):

Plaintext:  killthemall!
Key:        altdorfaltd!
Ciphertext: kteohyjmleo!

So, that tells you how to encrypt some text. In the book, the challenge is the opposite – Schwarzhelm needs to work out what Lassus was saying. Without the key, this challenge is almost impossible. However, he stumbles fortuitously across the keyword, which is ‘Wenenlich’ (the name of Schwarzhelm’s home village). Once they have this, they have a chance of cracking the code. On page 207, an extract of Lassus’ letter is reproduced:


No, not that kind of Cypher...

To decode this, you need to use the alphabet table again. The process is very similar, but you’ll need to get your letters from the top of the table, rather than the middle of it. Just as before, move to the row given by the first letter of the key (‘w’). Now scan along that row until you get to the first letter of the ciphertext (‘j’). Once you’ve found that, scan up the column to get the letter at the top (‘n’). That’s the one you need. Once you’ve done that, repeat the process with the second letter of the key and the second letter of the ciphertext, and then again and again, until you go mad from frustration or boredom.

To get you started, here’s the first bit done for you:

Ciphertext: jlyvrataa
Key:        wenenlich
Plaintext:  nhlreplyt

You might be thinking ‘What the hell’s nhlreplyt?’ Well there’s a final complication. Even after you’ve deciphered the text, you’ll discover that (a) there are no spaces and no punctuation, and (b) there are plenty of abbreviations. So ‘n’ is a fragment of a preceding word, and ‘hl’ are the initials of Heinrich Lassus.

In case all of that sounds like far too much hard work, then here is the ‘raw’ deciphered text. Don’t carry on reading if you don’t want any spoilers!


And if working all that out is too much of a chore too, then here’s what it looks like with spaces and punctuation added and some abbreviations expanded:

…n. HL reply to last message. LS sent south. His man Gruppen in Ostland. Only Grunwald remains of command staff. Will be with you soon. Cannot help feel regret for part in this. Was time when loved him as son. Even now do not think will break easily. Proceeds joyroot distribution received. Deposited securely. All else in hand. Still caution against Helborg but you make own mind up. After much work greenskins ready to play part. Defences weakened and funds received Black Fire Keep safely. HL.

So there we are. That’s how to decode and encode messages written in the ‘Vignius polyalphabetic cipher’ that Verstohlen refers to in the epilogue. I hope that anyone who tried it had fun, and didn’t end up with a broken brain (as I did, sadly, trying to write the damn thing).

Categories: Warhammer Fantasy
  1. 30 March, 2011 at 19:40 | #1

    You nerd.

  2. 30 March, 2011 at 21:47 | #2

    In an entirely good way, of course.

  3. 30 March, 2011 at 22:25 | #3

    That is so damn cool!

  4. 31 March, 2011 at 13:22 | #4

    … no one likes a smart arse Mr. Wraight ;)

    I am so totally stealing that for my RPg campaigns.

  5. 31 March, 2011 at 19:21 | #5

    The novel (and the prequel) were awesome.

    That we were treated to this incidence of breaking the usual boundary of story and reader was the icing on the cake.

    I wonder if Luthor Huss will spend his spare time solving sudoku :-)

  6. 31 March, 2011 at 19:27 | #6

    Slaves to Darkness? No, we Black Library writers are truly Slaves to Detail. What we won’t do in the pursuit of literary entertainment. : ) By the way, added your fine blog to my blog list. Cheers, Rob.

  7. The Wicked Worm
    2 April, 2011 at 21:02 | #7

    Cool, thanks!

  8. Pete
    8 April, 2011 at 09:11 | #8

    Wow Chris – I’ve started reading your blog cause I’m a 40k / Wolves man and followed ADB / Abnett for a while – and so far thanks to you I’m gonna come along to Excel center to get the Fang book.

    Now – Although I dont read that much Fantasy stuff – I do work in/with Cryptography so I’ve just gone “wait… this is amazing – ok, very simple by todays standards in IT Security but having studied the history of crypto I have just wet myself in a good way – a Black Library book with some actual Crypto / Cipher work in it.. my dream! Indeed not Cypher who is actually unrelated to my proffesion my fav 40k char being an ex-Dark Angels bod…

    Will have to pick this book up – and try and forget the fact the solution is on this page to re-work it for myself :P

    See you at Salute!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 66 other followers

%d bloggers like this: