Monday 11 April 2022

The Cipher - Chapter 4 (short story)



After the snack break, they got back to work again. Cassie looked at the program Phil had created. It was at a higher level than she would have programmed, but she understood what it did. She looked at the snippets again.

There was no way the divisible by four thing was accidental. This cipher worked in pairs of hexadecimal numbers. It could be the Playfair cipher, but that would be hard to crack. No, that couldn’t be. Dany wouldn’t expect Jake to crack that. It was doable, but it would require a considerable amount of subject knowledge and a lot of maths. She couldn't expect Jake to convince someone else to do it for him either.

It had to be much simpler. Especially if, as she suspected, it had something to do with Jake’s upcoming birthday. That would be completely consistent with Dany’s character.

Unless it really was Playfair and the keyword was something significant to the two of them. If that was the case, they were doomed. There was no way Jake could recall something like that, and they'd all be caught in the crossfire.

Cassie pushed it to the back of her mind. The Playfair thing would be a last resort. No, she had to think simpler. What if two hexadecimal characters represented one letter? Sure, it was wasteful, but it would work.

How would she do that?

The most obvious would be adding the two characters followed by modulus 26. Cassie decided to try modifying the program on her own.

This took a bit of time. She had Phil’s code as a starting point, but she still had to look stuff up. After messing with it for about ten minutes, she ran the code. Immediate syntax error.

Cassie was used to this. She checked the code and realised she had missed a single quotation. She fixed that and ran the code. It spit out a result for the first message.

VLLIXIHXUETNONBRZMBNQWHGJWDGMNKSLRRFQOCJMMIEXPMAPPKZJOQXQHQZOXXMFQPWOTDWAUNAIUCVNKBNGNWFYWGUZANGWKTLELOXJECRZLLAA

That didn’t look better than anything else they had so far.

Cassie leaned back in her chair.

She thought for a moment. Then she remembered what they had attempted before the snack break. She could try other alphabets, such as including a space, including numbers, special characters, all of that. Now that the code was set up, it was child’s play. She ran it with just letters and space first, so that it would have 27 possible characters.

I CAN ARRANGE SOMETHING AT THE MALLTHE CAFE ON THE SECOND FLOOR DOES PARTIESYOUR JOB IS TO LURE HIM THERE SOMEHOW

So that was it. It was absurdly simple. You just added the adjacent hexadecimal numbers, found the remainder when it was divided by 27, and matched it to A-Z and zero. There were no keys, nothing. The really clever part was a sort of randomness built into the code that would fool most traditional code breaking approaches. 

She had to be friends with Dany.

Cassie forced herself down to earth again. She looked across at Jake. He was on his phone, smiling at something. He was still distracted. He hadn’t seen her reaction. Good.

She put the next message in, line by line this time.

STOP STRESSING ABOUT IT
EVEN IF HE SUSPECTS SOMETHING HE WONT REALLY KNOW UNTIL THE DAY
CAN YOU THINK OF A WAY TO INVITE HIS FRIENDS WITHOUT ALERTING HIM

Both looked like messages to Dany from someone. Cassie copied the next message into the code.

JUST TELL CASSIE OR ANNA
YOU WERE IN THE SAME CLASS IN THE FIRST YEAR WERENT YOU
ANYWAYS I DIDNT BOOK CAFE
STUDY AREA WILL DO AS YOU SAID

Yep, this was definitely Dany’s way of inviting them to the party. Cassie nudged Phil and showed him the results she had copied into a document. She also typed in “don’t tell Jake, it’s about his birthday party,” under it very quickly. He understood. She nudged Lex and showed him the document. He nodded. Anna was staring at her laptop, so there was no way to get the message to her without alerting Jake.

Phil took a look at her code quickly. Then he stopped the decoding program he was running and started creating a program to do the ciphering. It took him some time. He was in the middle of this when Jake looked up.

“Any results yet?”

Cassie quickly collapsed the run panel on her IDE so that Jake wouldn’t be able to see the decoded answer, even if he walked over and looked at her screen.

“Not yet, but we might be getting warmer,” said Lex, “this might take a bit of time.”

“So, what cipher is it?” asked Jake.

“Playfair, probably,” said Cassie, quickly, “that seems statistically likely.”

“So are we looking at a long solving time?” asked Jake.

“Yeah, there’s a lot of possibilities, in the tens of thousands if my maths is correct,” said Phil, “I need to concentrate.”

“Okay,” said Jake. He returned to his phone.

Meanwhile, Cassie looked up Jake’s birthday. It was the next day. Well done, Dany, she thought, well done.

Cassie watched as Phil typed in the code as fast as he could. Cassie had some idea about what Phil would do. He was trying to write a reply to Dany.

It took him a few tries to get it to compile without errors, and two more tries to generate a proper message that Cassie could decode. Finally, he generated a message and sent it to Cassie.

d2783b90471d752cd54cfe32cd7b5b4690a56d39bd48a12e56166e8bc44ead2aa39c992c32966fc5e6ae8638c54d0848c88f47b37c2adc431e01
1dcaf1909e5da00de12c5435950d179d298b1496dc0031a6c366692b441a5c9794af8919fb050ab6aecbf7a904368fcc

Cassie decoded it.

GOT THE MESSAGE WILL BE THERE
PHIL CASSIE ANNA AND LEX

Cassie nodded. So did Lex.

Phil sent the ciphered message to Dany.

Lex stretched like a cat.

“Look, this is going to take a while,” he said, “wouldn’t it be better if Phil ran this overnight?”
“Good point,” said Phil, quickly.

Anna looked up.

“You sure it’s Playfair?”

“Pretty sure,” said Cassie,

“Okay, let’s meet again tomorrow then,” said Anna, “Jake?”

“Yeah, let’s do that.”

They all went their separate ways after that. Phil messaged her afterwards with a ciphered message from Dany. She checked it. It was Dany simply confirming it. She was about to reply when Phil sent another message saying he decoded it already.

The next day, Cassie showed up at study area on time. Dany had informed them that she’d bring Jake along after all. Phil had managed to keep Jake at bay by telling him that they had to consider another alphabet for Playfair and that they were all working on it remotely.

That was how they managed to surprise Jake completely.

After they cut the cake and had a bit of a party, Dany finally came clean about the cipher.

“So wait, you were using it to plan a birthday party?”

“Affirmative,” said Dany, “and I used it to send a message to them as well.”

“You were in the know the whole time?” asked Jake.

“Nah, we cracked it, realised what was going on, and messaged her.”

“So, when did you really crack it?” asked Jake.

“Yesterday,” said Phil, “when Cassie said she was sure it was Playfair.”

“And you’ve all been lying to me since then? And I had no idea?”

“Basically,” said Lex, “Hey, it was for a good cause.”

“Show me the messages.”

Cassie showed him the translations. Jake read the messages over and over a few times.

“How did you know it wasn’t a kidnapping?” he asked.

Cassie rolled her eyes. “First, the sender, Dany, doesn’t have the social skills to organise a kidnapping, no offense, Dany. Secondly, that’s an incredibly insecure cipher for one, and thirdly, no kidnapper would basically send us an invitation to the same place, and fourth, I remembered your birthday was on the day we had our end-term party last year. Is that a satisfactory explanation?”

Jake pinched the bridge of his nose and shook his head. He was clearly trying to not laugh. 

“Yes, it is satisfactory, unless someone was planning to kidnap all of us.”

“From within the university where everyone is recorded at the entrance?” asked Dany.

“Good point,” said Jake, “So, have I introduced two groups of cipher nuts to each other?”

Cassie looked at Dany, and Dany looked at Cassie. Dany nodded.

“Yup,” said Cassie.


------------------------THE END ------------------------



Read previous chapters: chapter 1  | chapter 2 | chapter 3

Thank you for reading! I hope you found this interesting.

Next week will be the code for this cipher, for enciphering and deciphering. Stay tuned for that.

The week after that, Cassie and co will tackle a real crime. Stay tuned for that!


You can also follow me on Facebook here.

Until next time!

No comments:

Post a Comment

How to write a character who is smarter than you

We all have that one character (or few) who is significantly smarter than the writer. So, as a writer, how do you write such a character con...