C is for Cryptography

 

For the sake of pairing some of these adjuncts to the novel alongside their respective chapters, I am taking liberties with the Alphabet for the next couple of days and so we come to C and not G…


My goal in the 2021 A2Z Challenge is to complete a novel I started a few years ago but which has languished for lack of love (writing!). Each Post, daily in April (Sundays excepted), will consist of some aspect of the novel plus a chapter from it. I hope that the Alphabetical items will give a bit of extra background, muse on the writing process, but most of all, help me develop certain ideas to improve the novel. Some 12 chapters are already written so I have a bit of a head start…
Please comment with any opinions good or bad – you have no idea how much I need feedback at this stage…

I once became fascinated by Cryptography – the use of a code or a cipher to disguise messages. The process consists of taking “plain text” message and encrypting it according to code. How that code works is known as the key. In the picture above, the key is to move all the lower alphabet to the right by four character and then read the plain text from the top alphabet and substitute the encrypted letter from the lower alphabet. Most codes involve some form of substitution but they have one big weakness – letter frequency! Some letters are more frequent than others in any given language and so by analysing the frequency of letters in an encrypted message, it is quite easy to figure out the plain text – especially with computers to do the counting. In the chapter below, we encounter The Beale Cipher – one which is almost impossible to crack because it depends for a key, on a piece of writing which is only known to the protagonists.

There is quite a bit of technical explanation in this chapter and my question to you, Dear Reader, is do you find this too much? Of course, it would help if you could tell me too, whether you are a nerdy type who would probably love this stuff or a creature of spiritual interests with no such interest!

Chapter 8
Endorsement
 

Jack and Stig were on their way back to New Orleans. Everyone had been shaken by the arrival of the two strangers. The train wreck, traumatic as it was, or rather, the consequences of it, as neither Jack nor his mother had truly experienced it, had begun to recede. Now, like one of those nightmares where an implacable force pursues you relentlessly, there was present threat and danger. Stig had taken control sending Jack’s mother to a neighbour with young Douglas. Jack accompanied her on a path through the woods and they slipped into the back door without seeing anyone. The neighbour agreed to convey the baby and grandmother to another friend of hers after dark and for the sake of safety, agreed to ask for no explanations in the knowledge that eventually they would get the whole low-down from their dear friend and neighbour.

Jack returned to his mother’s house without incident and after setting a timer for lights and drawing the curtains, they were collected by Lars and departed carrying rifles and dressed as if for a hunting trip. This time the rifles were loaded unlike the bluff they had perpetrated earlier in the day. Stig was of the opinion it wouldn’t have mattered if the “visitors” had known the rifles weren’t loaded, they were simply unprepared for the presence of three large, armed men and had withdrawn to rethink their approach. Which was pretty much the same position as Jack and Stig found themselves in. Whilst Jack had been away, Stig had contacted his inside man in the Rangers and given the vehicle number plate which had turned out to be a hire car. The customer was registered to a false address and driving licence. This told Stig that whoever was behind the men, they had local help, although the level of crime was so low on Hawaii 2 that it was not difficult to set up such scams and organisations were not on the lookout for criminal activity either. Next Stig had organised a small protective force to camp out near the tree-house. They had decided not to alarm Chloe by telling her anything but to place some surveillance cameras on the paths approaching the house, monitored by the protective force who were ready to respond accordingly. If Jack had ever had any doubts as to the veracity of Stig’s explanation of his position in the scheme of things, they were gone now. Stig clearly had access to the highest levels of government including covert forces the existence of which would have surprised most citizens of the planet. Jack himself was beginning to be inured to surprises of all kinds from sudden fatherhood to hostile powers but he was glad that people like Stig were there to look out for the planet and right now, for him. Having apparently issued instructions to cover all bases, Stig lapsed into silence for a while and then turned to Jack.
“With all the ‘excitement’ I had quite forgotten something!”
“What’s that?”
“Well, I have the pendant with me and we have identified the folder which is almost certainly Anna’s research but it seems my talk to her had an impact on her because she has password protected it. If necessary, we could recreate the work from her search history which we copied but destroyed in the public record as I told you before. At this stage it doesn’t matter about the detail of the work itself especially as we can recreate it eventually which is why I hadn’t mentioned it to you yet. However, it occurs to me that it might contain clues as to who might be so anxious to get their hands on it or to destroy it, whichever it is…”
“But you don’t have the password – is that what you are saying?”
“You’re very quick Jack! Maybe you should consider Investigator amongst your future career directions!”
“I wouldn’t be thinking about any of this if it wasn’t for wanting to know what happened to Anna and if I had any choice, for that matter.”
“True enough, I am sure you would rather just be spending time with your son and thinking about new building projects but as you say, we have no choice. Let me tell you about this password. We think that it’s encrypted using a book or substitution cipher based on a unique text. If it was to be sent between two people and they both knew the exact piece of text to be used then they would be able to encode and decode at will.”
“As it happens, cryptography was one of Anna’s hobbies that I shared an interest in. As you know, I wasn’t so smitten with all the technical stuff but cryptography is like a brain training device and we used to set each other tests. The only thing that sometimes spoiled it was that once we started to crack the messages, which were usually love letters, the content wasn’t too hard to guess.”
“Fantastic Jack, we were really hoping you might be able to help suggest the unique text but it sounds like you might even be able to crack it altogether!”
Jack sat thinking for a few moments before replying.
“You know a while back, listening to you make all sorts of arrangements, I was convinced that you must be who you say you were but now it comes back to accessing the work again. To be honest I had forgotten that you still had the pendant and forgive me if I am being paranoid but I suddenly don’t feel very trusting again. If this is all about getting Anna’s work and you still need access to it…” Jack shrugged his shoulders as if trying to rid himself of something.
“I don’t blame you Jack, but I think I can introduce you to someone who can convince you of my bona fides.” Stig took his phone out and dialled a number. “Good Afternoon Sir. I need to brief you as to developments in that matter we were talking about.” Stig paused, listening. “There have indeed been developments plus I have someone here who needs to meet you.” Stig listened for a moment more and then replied, “Yes Sir, about two hours then.” Stig put the phone away and speaking to Lars said, “We will need to get changed on the way,” and turning to Jack, “after all we can’t go to see the President looking like country hicks now can we Jack!”
Jack discovered he was not as inured to surprises as he had thought.
 

¤ ¤ ¤ ¤

The President of Hawaii 2 was in theory, an elected role of largely symbolic significance but in practice, the same man had held the office for so long that it had almost acquired the nature of a benign hereditary position. In fact, for those bothered by such things, it might be remembered that previous Presidents had indeed come from the same family as President Robert Widness. However, the inhabitants of Hawaii 2 were not bothered – the President had no apparent political power, that resided with parliament where Members took election more by community rotation than from any great political ambition. The issues faced by the Parliament were simply an extension of those faced on a more local level, where the rotation through the administration was for most, an irksome reality that had to be faced from time to time. So, although the planetary Parliament was an elected body, it brought no great kudos and neither, as far as most people could see, did being President. The fact that Robert Widness was content to stay in the “job” indefinitely rather than moving through life’s varied opportunities with the freedom which most ordinary citizens enjoyed, was his lookout. He lived as modestly as the rest, did not seek to impose his will over that of Parliament and there was something reassuringly Patrician about his manner that most people secretly enjoyed. If any issues arose in regard to the Pan Human Federation or any of its member planets – you felt that President Robert Widness would have Hawaii 2’s back.

Jack was as familiar with the President’s appearance as any citizen of Hawaii 2 but meeting him in the flesh was still a matter of gravitas – the President was six foot four and solidly built, august grey locks that extended down into sideburns framing piercing blue eyes and a clean-shaven, square jaw. He also proffered a very firm handshake to Jack.

“First let me say how sorry I am for your loss, Mr Gulliver. May I call you Jack?”
“Yessir. Jack is fine!”
“Well Jack, your late wife was brought to my attention when she applied to go off on her trip. It put us in a dilemma. We knew if she didn’t go but settled down to have a family with your good self, then that might be the end of it, but it was clear from her application that Anna was very passionate about the possible beneficial outcome for Hawaii 2 that could spring from the work and we worried that she might pass the baton to somebody else who might spread the word further afield. We pulled the strings of the selection board and dispatched Mr Johannson here to have a word with Anna on her way to
Hawaii 1 as I believe he has told you. I can understand why you might be in something of a spin with everything that has happened to you but believe me you are in safe hands with Mr Johannson – Stig. You know it’s not that we don’t want to see the development of easier access to the planet but we want it to be on our terms, we want to be in control of the development and of the pace of change should it happen. I think we can all see the dangers inherent in the opposite situation now and the question is how to proceed. I come from a family long involved in politics but my background knowledge of Hawaii 2 is nothing compared to Stig’s which is why he is one of my most trusted advisers.”
“Well Sir, Mr President, then I guess that’s good enough for me! And I am sorry I doubted you Stig.”
“That’s okay Jack. I appreciate your caution and sadly it looks as though that is exactly what is required at the present time. Wherever and whoever this malignancy is coming from, for the sake of Hawaii 2 we have to root it out. You have lost so much already but can we ask for your support in trying to solve the mystery…”
“It’s not what I want but it feels like I have to do it, for Anna’s sake and for the sake of Douglas’ future, well and my own and Hawaii 2’s.”
“Well said Jack!” Said the President. “And thank you. So Stig how do we proceed now?”
                                                            ¤ ¤ ¤ ¤ 

Half an hour later and Jack and Stig were seated in a conference room in Government House. They had been joined by two professors from the University of Hawaii 2, Walter from the Department of Mathematics with an interest in cryptography and Rex from the Department of Engineering who Jack knew to be one of Anna’s supervising colleagues.
“Okay Jack, this is what the password text is on the file. As you can see its very long so we think it might be doubling as a message or some kind of warning so we have been loath to try and open it with any attempts at decryption that we are not sure about. We don’t want it to self-destruct…”
Walter passed a piece of paper

 to Jack on which were written a string of numbers.

11126,968,628,68,9622,28114,24,821,15,16,39,17,23,2*14,28,48,24,16,1621,215,68,22,

A smile spread across Jack’s face. “This is easy!” He said. ”The three ones at the beginning are a private code to tell me which cipher she was using – its a Beale Cipher, its Homophonic and the text we always used is the United States Declaration of Independence as in the original Beale Cipher. The three ones are because it was the first piece of Cryptography Anna taught me. Tears welled up in Jack’s eyes and he bent over the text to hide his face from the assembled company. “I could probably decode this from memory but to be on the safe side we had better get a copy of the text – if that’s possible?”
Walter quickly accessed a computer and brought up the Declaration for Jack.
“Okay, so…” Jack started writing beneath the encrypted line. “First off, the commas always follow a number in double figures so when we space out the numbers accordingly, we get this.”


26 9 68 6 28 68,9 6 22 2 8 1 14 24 8 21 15 16 39 17 23 2* 14 28 48 24 16 1 6 21 2 15 68 22

“Each number represents the first letter of a word in the Declaration and we have to go all the way to the twenty-sixth word before we find a word beginning in ‘F’ whereas only as far as the ninth word for one beginning in ‘O’. We have all the way to word 68 for an ‘R’ so the first word of the plain text is ‘For’!” Jack beamed, caught up in this old, shared passion which his late wife had introduced him to.
“The next letter is followed by a full stop which means an abbreviation and as the letter decrypts as ‘T’ that makes it the word ‘the’.” Jack started counting off words on the Declaration and writing down letters in the plain text line. “Ah! Here is a homophone!” he exclaimed. “You see this next word is ‘protection’ which contains two letters ‘O’ and in the first occurrence Anna used the first word in the Declaration to begin with an ‘O’ but the second occurrence uses the second time it occurs in the Declaration so we have word 9 and word 14. This is what makes the Beale Cipher strong – the two different numbers for what is a common letter helps to disguise it when frequency analysis is applied. Okay let’s see, the next word is of, ‘O’ followed by a full stop and this time it has reverted to the first occurrence of the letter in the Declaration – word 9! So now we have ‘For the protection of…’”
Meanwhile, Walter had accessed the Declaration brought over a printed copy of that text on which he had numbered each word which he handed to Jack and with this it took him only another minute to decode the rest of the encrypted text.
“It reads’ For the protection of Hawaii 2. Open with care.’ – what does she mean by that?” said Jack.
Everyone looked thoughtful as they tried to digest the strongly worded message from Anna. Walter was first to speak. “Firstly, may I say that yours and Anna’s personal variant on the Beale Cipher is very effective, my only criticism from a Cryptographic viewpoint is that using the original text of the Declaration might make it possible to crack although it would have taken me a long time I confess! But there is still one problem before we can use the password – what do we do with the spaces between words – you can’t have spaces! What do you think Rex?”
“ Anna was famous or is it infamous for her lengthy passwords – I asked her about them once and she said she liked to use phrases – different for each circumstance but contextual so she could remember them easily and she told me she used underlined spaces between the words but Jack, I am sure you knew Anna best in this respect – what do you think?”
“You’re right Rex! Go with the underlined spaces.”
Nobody seemed eager to enter the decrypted password in case some unforeseen consequence might follow but eventually, Rex stepped forward and input the plain text and uttered a sigh of relief when a set of files appeared on the screen. Mostly they were pdf’s and opening them they proved to be prints of documents Anna had accessed on her last trip. One file had a very long name that began ‘For Jack’ followed by a string of gobbledygook. Rex tried to open it but it was password protected. “Looks like an encrypted password in the tile Jack.”
Jack moved closer to the screen and scrutinised the file name. “That’s odd!” he said. “It begins with 113. That means the Beale Cipher and Homophonic but although we had a second text alternative to the Declaration, we never had a number 3 text… I’ll have to think about this…”
“Presumably that is a personal message,” said Stig “we seem to have all the technical aspects of Anna’s work. Rex can you make an assessment of the work please and report back directly to me. Walter thank you for your assistance.”
“The pleasure was all mine Stig! Most interesting Jack, perhaps we could have a chat about cryptography sometime at your convenience – perhaps over a meal in the University?”
“Certainly Walter, once all this has settled down, though it was Anna who was the real code buff…”
“Thanks, Jack, I’ll be in touch then,” said Walter as he gathered his things and left the room.”
“So Stig can I have the pendant back now, perhaps with the Personal message put back onto it so I can puzzle over it?”
“Certainly Jack! Can you do that please Rex. But now we need to decide what to do next. We still have persons unknown running around for reasons we know not who or what! If you are amenable to staying with me on this, I can keep an eye out for you and use your help at the same time?”

“Anything that helps to make sense of all this is fine by me and I feel safer with you than on my own out there…” Said Jack with a shrug of his shoulders and a look of relief.

“Fine!” Said Stig “Consider yourself recruited  – Special Deputy in the Rangers – well not officially maybe but…”

2 thoughts on “C is for Cryptography

  • May 23, 2022 at 9:21 pm
    Permalink

    Works for me! But as you know, I have some fondness for cryptography.

    I’ve been puzzling over how much I can learn about the details of what the thousands of codebreakers in Arlington Hall actually did, how much I want to learn, and how much readers would tolerate in a novel.

    Reply
    • May 23, 2022 at 10:22 pm
      Permalink

      It’s a tricky one isn’t it – knowing how much detail to go into… I have read a lot of historical novels featuring naval battles of the Napoleonic wars (eg Master and Commander) and although I enjoyed visualising the battles, I thought that someone who wasn’t so interested could just cut to the chase without losing anything as long as the “chase” is well signposted. On the other hand, in Herman Hesse’s – The Glass Bead Game – the “game” is never really described but because the real content is around the game rather than the game itself, it works – so two different approaches…

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *