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!

Monday, 4 April 2022

The Cipher - chapter 3 (short story)

chapter 1  | chapter 2 |  chapter 4

Cassie decided to sleep on the problem. She knew that helped with some problems, particularly when she was stuck on assignments. Her dreams that night were filled with hexadecimal numbers and all sorts of ciphers, but she slept well regardless.

She spent the morning doing other stuff. After all, Phil wasn’t going to be up until midday anyway, and they didn’t have lectures that week. They had one coursework presentation, and then next week, they’d be free to leave the campus.

She had lunch and watched some stuff just because. She was halfway through it when her phone rang. It was Jake, who wanted to meet in the study area for a cipher cracking session. He promised snacks, and Phil had agreed to come. Cassie had no objections to that.

She joined the others there. Phil’s ridiculously powerful laptop was running, and currently, it sounded a bit like a hairdryer. He looked up when he saw Cassie.

“No results so far. How about you?”

“Same. Any new leads?”

“Nope.”

Cassie put her laptop bag on the table. “I’ve been thinking, like, should we change our approach?”

Phil gave her a quizzical look. Cassie took it as an invitation to continue.

“Well, how would you encipher something if you wanted to communicate with someone in secret?”

Phil thought for a second. “I’d use a proper cipher algorithm.”

“No, if you couldn’t do that?”

“Why would that be difficult? Vigenere with an easy to remember, ridiculously long key,” he replied, “Do you know it’s theoretically unbreakable if the key is as long as the message?”

True, and if that was the case, there was no way they were breaking it. Cassie turned to Jake.

“What about you?”

“I’d type it in windings.”

“Forget I asked. Anna?”

“Same? Or maybe A=1, B=2, and so on. That’ll be easy to break though.”

“It’s extremely easy,” said Cassie, “seriously, guys, can’t any of you think of an original approach?”

“Maybe if given time,” said Phil, “all that’s required for a cipher to work is that it takes some texts and spits out unintelligible text at the other end, which can be translated to the original text at the receiving end. Ideally, you wouldn’t lose any information in the process. Or introduce ambiguity because languages are a mess as is”

Cassie nodded. “But additional information would be okay.”

“Absolutely,” said Phil, “but it’ll be wasteful.”

“Wouldn’t be a problem if you’re not putting it on the internet, or dealing with large volumes,” said Cassie.

Phil nodded. “So you’re saying this cipher might be a bit wasteful.”

“I’m just considering possibilities.”

“Like skip codes?” asked Anna, “what if you ciphered a skip code the traditional way?”

“Yep, that could work,” said Phil, “I’ll try that on the text we translated the way Cassie suggested.”

“Assignments?”

Everyone turned. It was Lex, a fourth year.

Jake told him what was going on. He immediately volunteered to help. He, too, sat down with his computer, which he had with him for some reason.

“The skip code idea has some merit,” said Lex, “but it’s a bit basic, don’t you think?”

“Hey, not everyone remembers resistor codes, let alone using them for a random cipher,” retorted Cassie.

“Look, I detest econ with my entire being. I simply wanted some sense of normalcy, hence I defaulted to what I liked, what I was comfortable with, and did not include weird interest calculations…”

“So you’re saying we need to find what Dany likes?” asked Anne.

“Easy,” said Jake, “she reads / watches a lot of mystery-related stuff. She is also absolutely obsessed with fantasy as a genre. She loves programming and solving silly little problems that most people would do with pen and paper. She is very good at maths and enjoys it. She is organised in a chaotic way. She has also developed an obsession with fermented food recently for some reason and I think I’m catching it too. I think that’s it.”

“Fermented food?” asked Anna.

“Yeah, that’s the least relevant thing, let’s focus on that,” said Lex, “though seriously, liking maths and programming for the hell of it sounds more relevant to me. This suggests something simple but effective. Such as a Vigenere cipher.”

“Exactly, thank you!” said Phil, “we’re not going to crack this.”

Cassie rolled her eyes. She turned to Jake. “You said she’s weirdly happy about this situation. What sort of happy is she?”

Jake shot her a blank look.

“Is she the evil-I-have-fooled-you happy or is she just super giggly?”

“Well, she has been giggling a lot and I haven’t seen an evil witch look on her, so…”

“That means we can break this! Don’t you see? She wants us to break it,” said Cassie, “that means it’s a breakable cipher, or at least she thinks it is, which is not always the same thing, there was this once time….”

“Alright, so you’re saying it’s not Vigenere?” asked Phil.

“No, I’m saying it’s breakable even if it is Vigenere,” said Cassie.

“Alright, I’ll try that next,” said Phil, “once this is done trying what it’s trying right now. No results so far though.”

Cassie looked at the numbers again. It was a groups of four. Then another idea struck her.

“What if it’s Playfair, but converted to hex and she’s added a random multiple of 26 on top to fool us? That would definitely work.”

“Actually, that would,” said Phil, “but we’ll have research about breaking a Playfair cipher then.”

“Why 26?” asked Anna, “why are you assuming it’s just letters? She could have added numbers and spaces and special characters and all of that.”

“Normally you’d replace spaces with an Z before you cipher it,” said Lex, “and you’d avoid special characters and spell out any numbers.”

“But what if she didn’t?” asked Cassie, “how obsessed is she with ciphers, Jake?”

“Based on other people in my life, about average, I guess?”

“So she likely knows about that trick,” said Lex, “and she’d use it unless she plans to talk about pizza a lot….”

"She does like pizza," said Jake.

“You could replace it with an X,” Cassie pointed out.

“True,” said Anna, “but what if she chose not to? If she added just space, it’s going to be 27 characters. If it’s upper and lower case letters, it’s 52, plus space, it’s 53. If you add numbers, it’s 62 or 63. I think we should try all of that.”

“Easy enough,” said Phil, “so, did you guys do any programming?”

“A bit of micro c, python, java…” started Cassie.

“Perfect. Can I burrow your computer? I’ll just code that quickly.”

“Sure.”

“Dark mode IDE. I see you are a woman of culture, Cassie.”

Cassie bit back a retort. Sure, she didn’t have a good sleep schedule, but she didn't think Phil could look at a light mode anything for more than ten minutes at this point.

Phil produced the first output in a few minutes.

“This is A-Z plus space.”

KZA LSEX OUGWFZTJIMPUURQORDXMGP LBLUHMRRKZRXGAISMPTAEWTABGEAXDAMFWUSXPILI AENNPODYVLF MOSXPZBZTAAHCCKQASZGQNUVPZCBOMVLWQGIUVZTJRBCWTROASHTTXFWLGSBBHVKRBNLSXFPYUYCBI PIUPLUPEOLPBSZQYCFGHNXVCCOMFCSRTUTHNGOUVKFMAEEWBRYRUTYHDEP UC

“This doesn’t make a lot of sense,” said Lex.

Phil was typing away furiously.

“And this is with upper and lower case, no spaces.”

QffgNYjZgrzjWLZyJlOqYvRWSwJEvGRauFmampVsQAyyGbMUrsuCGxAGBllCfFdpLaxUyTnsKgdlooqtieAmiaQOWbqZgGVfIHIhtrhSAjYqvVudIiQrAqevGIaXAXRVcdxTXSAWPZTAFYoItHimdKsiuovZLRYxFIcIHunaTNxqGQqPcWbvDdmImNdXGhUMoItRZUALVjOxCMLMfEfzeyaRaZDiehVFxd

“That’s objectively worse,” said Lex.

“And this is with upper and lower case and space.”

NcddMVhYdqxiWIZwJkNqWvRTQuGArGQaqDmXkoTsN vyGbKTpruBFxxDBjiBbEcoIYwTyRlpJdciooqrgbymhaOOUZqZeCUdEHFfpreS iUpvVsbFfPpyoatGIXW VNTcdxTUQAULWTzFXnHtEfkZKsfrnuYIQYwBFcIDslXRMwqFPoPcUatAdjHkNaWEfRMkFtRWUxJRiOwzLIMdEfydvZRXWAiegSCwd

“And this is with numbers.”

u9J C2NO gdYWpZcJaDqCvR07anXDGGaCum4Qe su0RyGb1JVhu26xTkBPE2y5SepEmJy8RL  SEooqXM8emXa5OAFqZKZKJbHmLBrAS0YrfvVYHmBFVeUxZGI4M0Bk cdxT17AAi3TpFNd8tlBQwKsBNdkOpGYmYmcIaYR48Cmq6FUPcAQZhdF8QN7MvLyM7mtR3UT0oYOmVBpMJEfoTRPR43hieWzjmd

“None of them make sense,” said Lex.

“Well, something has to,” said Cassie, “Unless this is a convoluted ploy by Dany distract you, Jake.”

“Why?”

Was it a significant day to the two of them? Say, the day they met each other? Not according to what Cassie could remember, unless they were already dating before they joined the university. That was unlikely as their nationalities were different. What about Jake’s birthday? That was possible. She remembered going out for a term end / birthday party last year, so that was entirely possible. But then, Jake should have realised that.

“You can figure out if that’s the case,” said Cassie, “unless you have any other pertinent information that may help us…”

“Seriously, does anyone have any ideas?” asked Lex.

“Snack break talking about something else?” asked Anna, quickly, “like which movie we are watching on Friday?”

That made sense. The group decided to have a snack break. As promised, Jake bought snacks. Phil’s laptop still sounded like it was preparing for take-off. They spent a few minutes chatting about other stuff.


END OF CHAPTER THREE

Read previous chapters: chapter 1  | chapter 2 
Next chapter: chapter 4

Thank you for reading! Do let me know if you manage to crack the cipher. It doesn't need a key, and the stuff they've figured out so far might give you a few clues. (hint: it's straightforward, but not a common cipher algorithm).

You can read more about the Vigenere Cipher here if you're interested. The cipher in question here is not a Vigenere Cipher though.

The next chapter will be uploaded next Monday, 11th April.


You can also follow me on Facebook here.

Until next time!


Monday, 28 March 2022

The Cipher - chapter 2 (short story)

 chapter 1  | chapter 3 | chapter 4


The computer finished booting up. Cassie opened up the browser to get the code into her computer. She checked her emails too, just in case. There was an email with no subject from Phil. Typical.

“Not ASCII, not UTF in any form unless special characters are supposed to mean something, no other common type of encoding I can think of. I’ll check if it’s something super obscure.”

Cassie had been afraid of that. She copied the numbers into a ciphertext to a text file and looked at it.

acbb87bc41b48b4dbc5f9b5716a7199a0959422a802f11b27a98a5d4ff06451afe6d26b68e5d7d2cac34ce32061b744893602e363a31d0a2018dc136ef39515da7826548327b

8fc83ebc51c128282a958aba9c26561a780e7e832a1988d64987d807a489fd2bbd123457e85e2f159685a4be44939c92ee970608b64b347fe17d1c1d3113b37a007edfb51368054c5c3c2da3be8eed0a2cbe

ca5c634da7451865d5a41c08d7968fb67b41652a3a44920f1c7e4f979f1dc23c8e0db94b6e89b00cf8a42d11b514d073e5570e65d240a70c87041f6752ce4e11b6b59f221e55b1a1651d

First things first, she had to find the length of the lines. This was easy enough. She wasn’t going to count it manually – not with this many numbers to count. Instead, she let her word processor do it for her. 140, 164, and 148, counting it line by line. Cassie noticed right away that all these numbers were even. No, not just that. They were divisible by four. That was the largest common factor. This made it very likely that she would have to look at sets of four numbers, which was four hexadecimal digits, or two bytes.

Cassie typed this out in response to Phil and sent it.

The next step, then, was to split the text into groups of four.

acbb 87bc 41b4 8b4d bc5f 9b57 16a7 199a 0959 422a 802f 11b2 7a98 a5d4 ff06 451a fe6d 26b6 8e5d 7d2c ac34 ce32 061b 7448 9360 2e36 3a31 d0a2 018d c136 ef39 515d a782 6548 327b

8fc8 3ebc 51c1 2828 2a95 8aba 9c26 561a 780e 7e83 2a19 88d6 4987 d807 a489 fd2b bd12 3457 e85e 2f15 9685 a4be 4493 9c92 ee97 0608 b64b 347f e17d 1c1d 3113 b37a 007e dfb5 1368 054c 5c3c 2da3 be8e ed0a 2cbe

ca5c 634d a745 1865 d5a4 1c08 d796 8fb6 7b41 652a 3a44 920f 1c7e 4f97 9f1d c23c 8e0d b94b 6e89 b00c f8a4 2d11 b514 d073 e557 0e65 d240 a70c 8704 1f67 52ce 4e11 b6b5 9f22 1e55 b1a1 651d

With that, she had to look for repeats. She couldn’t spot any. This meant she couldn’t attack it with statistical analysis.

What if the order of numbers didn’t matter? If the order mattered, 4 hexadecimal digits would give 43680 possibilities. Very few languages had that many characters. If order didn’t matter, it would be 1820 possible combinations. That was still way too much for most languages. Besides, almost every group of four in this cipher was completely unique. That was way too many combinations for English, at least.

No, this had to be simpler.

She looked at her mails again. There was one from Jake. It was another cipher.

“Dany sent this to my phone just now. She’s enjoying herself thoroughly.”

fe3dab0a1169be5f0a97f14ac7ab3e90756740c5cb1fe9994d9857bdaecba9b6bda371757d8acd544229f359a081

84a9e142604651af01bb551fc2519974be57193caa4812515b25768f86100817cc954a86df5ca01ca4101580d04a896e8863f15a06024d7d0a8383392e7bd83a737f9a8afa07dd8f3c282165745add506e345b52a6222b3e4808c76c4a65f7251b9de9c68483a228a0664712796ac215717a3fbbe29c0998f105044d9f1b

115d417cfa57bebb524d9488e7563bd2dfc9a936d1b1588d7a83d81a48b950215a62c49bd4c0b91a93966c84841dfbc85b04ffcb6497c9be933f9e4252cfbc8ce93ff1abf8c0c62482a641b71e7a6311a3399d2d2e7730ba1dd56439f671c4931d0578a4c35f6b2f0e783db6c8bdb641956f98895f81b9b3432fda9f09a0fe18994b

 

That was a lot of text. Cassie checked the number of characters in each line again. 92, 252, 260. Again, all of them were divisible by four. This had to mean something.

Just then, she got another email from Phil.

“Converting them to denary numbers as is makes no sense, I’m afraid.”

That should have been obvious. The email continued.

“We were taught a little bit about encryption so I’m going to try to apply some of the common encryption algorithms to this problem and see if it makes a difference. Might be limited without a key though, and it's entirely possible it's theoretically impossible to crack in a reasonable time. It’ll take a while, but I’ll automate it.”

That would be possible, yes, and Phil would do the job better than anyone. He would likely to find the answer too – Dany was a computer science student like him, so she likely had the same sort of knowledge base to start with. After all, that was how she broke Lex’s puzzle a week ago – Cassie was already familiar with the things he used as keys in that puzzle. In this case, well, Phil had that advantage.

Staring at it wasn’t giving Cassie any ideas. She watched something instead. Actually, she did that for a couple of hours, went out to buy something for dinner, returned to her room, and watched something again for another hour while having dinner. Then she opened the computer again. There was an email from Phil.

“Put everything together, program is running. So far, I’m not seeing any results. Will nap while it runs. Ciao.”

Typical Phil. He had the ability to nap anywhere at any time, and as usual, he put it to full use.

Cassie stared at the numbers again. There was no flash of inspiration at once. Then it struck. Would it be just modulus 26 like with all regular ciphers? That was entirely possible. Also, everything being divisible by 4 could be a huge coincidence.

Or maybe it was padded out that way on purpose.

Cassie tried the numbers pair by pair.

The first pair, ac would translate to 172 in denary numbers. The remainder when divided by 26 was 16. Q was the 17th letter in the alphabet, or number 16 when starting from zero. This would still make sense.

The next, BB, gave the answer 5. That was a problem – 5 corresponded to F. There were no words that started with QF as far as Cassie knew. She decided to try another pair for good luck. The next pair, 87, gave 5 again. QFF? The next pair gave G. QFFG. This was not good, unless it was a double layered cipher of some sort.

Anyway, she could try to translate this my hand, or she could use Phil to do the translation for her. This was precisely the kind of thing he was good at. She dropped him an email and tried to find something to watch. She found nothing. She checked her emails just in case, and Phil’s answer was there.

QFFGNYJZGRZJWLZYJLOQYVRWSWJEVGRAUFMAMPVSQAYYGBMURSUCGXAGBLLCFFDPLAXUYTNSKGDLOOQTIEAMIAQOWBQZGGVFIHIHTRHSAJYQVVUDIIQRAQEVGIAXAXRVCDXTXSAWPZTAFYOITHIMDKSIUOVZLRYXFICIHUNATNXQGQQPCWBVDDMIMNDXGHUMOITRZUALVJOXCMLMFEFZEYARAZDIEHVFXD

That made absolutely no sense, but it was sufficient for a frequency analysis at the very least.

The distribution did not look too bad, but it didn’t look too hopeful either.

There was another email from Phil. “Cassie, this doesn’t look like a simple substitution cipher, the distribution of letters is all wrong. My program is still running and it hasn’t caught anything yet either.”

He probably reached that conclusion by some form of statistical analysis. He knew what he was doing, but Cassie wasn’t quite ready to give up yet.

Then, Jake sent yet another cipher.

226e8d44288c80bc87352674536e677c59a56f9efd9a37866534acaab75f467bbb0144bd9e9c16a6f237606a8560a914

83a3dac99938cec60412262f73ac8b6cfe2a102e45a0a0014306ad4d48af2828491af74ddb094363a667308fc008e6941e605a90dcd3b9aeb77fad963b0e4eac3eb951bcd574d823458946895e3cdb9e1836b908bb536a644f37de971921b915c037b9987e6d1b5044401ec8ad75

bb6e55c6b05b8683a533f72f7590ae7a2c7e635938373509eaaee0c2cdc00daf2f59f4ca053fa705eca8729eef1fb876d939

42c3e9a44988d839bd9fe777559e4e4a4f0631a7024e953e997dd90a1f226521cfae237200357d9100cf1373f34ebc452a716755707a45ae726e5619

 

The lengths of the lines in this were again 96, 220, 100, 120. Again, all of these were divisible by four. This could not be a coincidence. This had to mean something.

Could it be a four-digit number in hexadecimal? No way. That was way too much information for a letter of English. As far as Cassie knew, Dany spoke neither Chinese nor Japanese, or any other language that would need so many characters. Okay, it was possible is was an abugida, either a South Asian or South East Asian language, counting letters and vowel marker combinations as letters, but that surely wouldn’t take more than three hexadecimal digits.

In short, Cassie was completely stumped.

Then Cassie received another email. She checked it.

“Dany suspects I’ve already given the cipher to all of you. She’s in an extremely good mood for some reason. It’s great, but it’s also a little weird because I can’t make head or tail of the situation. You will have to crack it. My reputation depends on it. I’ll bring snacks and give you moral support.”

Typical Jake. But right now, she could do with snacks and moral support.



END OF CHAPTER TWO

Read previous chapters: chapter 1

Next chapter: chapter 3 | chapter 4

Thank you for reading! Do let me know if you manage to crack the cipher (hint: It doesn't require a key). The next chapter will be uploaded next Monday, 4th April.


You can also follow me on Facebook here.

Until next time!


Sunday, 20 March 2022

The Cipher - chapter 1 (short story)

chapter 2  | chapter 3 | chapter 4


Cassie, Anna, Jake, and Phil were in the university canteen having some fruit juice. The exams were over, and the four of them had spent the entire day shopping. Okay, it was window shopping mostly, but Cassie had really enjoyed herself.

Anna and Jake were third year electronics engineering students like Cassie. Phil was a computer science student, but he knew them from first year classes and the four had bonded instantly over common interests.

“So, let’s go our own way, then?” asked Anna.

Phil yawned. “Yup. Need nap. Brain not functioning anymore.”

“Um, actually, there’s something I wanted to talk to you about,” said Jake.

Cassie blinked. Was Jake actually being serious? What was going to happen next, the complete reversal of gravity?

“You’re good at ciphers, right, Cassie?”

“Maybe? I suspect Phil knows a bit about them too.”

“I’m average,” said Phil.

“Anyways, I need you two to decode something for me. You have nothing pressing at the moment, I assume?”

“Other than stuff I’m basically tinkering with, no,” said Phil.

“I’m not too busy either,” said Cassie.

“Okay, so my girlfriend has been sending some random texts. It definitely means something to her. I saw the messages and asked her about it, and she forwarded it to my phone at once. The thing is, the damn thing’s in a cipher of some sort. I can’t make head or tail of it.”

“A normal person would just ask their girlfriend, you know,” said Anna.

Cassie nodded.

“Apparently it’s a secret but I’m free to decode it if I can. So basically, it’s a challenge. The problem, as you are aware, is the fact that I have absolutely no idea how to crack a cipher. I mean, I could learn, but this doesn’t look like the kind of thing you can crack with a two day crash course.”

“So, what’s the cipher?” asked Cassie.

“I’ll forward it to you. I’ll give you moral support, but I’m letting you know in advance that I am terrible at…”

Phil yawned. “Just forward the damn thing.” 

“Okay.”

He forwarded a message to Cassie.

acbb87bc41b48b4dbc5f9b5716a7199a0959422a802f11b27a98a5d4ff06451afe6d26b68e5d7d2cac34ce32061b744893602e363a31d0a2018dc136ef39515da7826548327b

8fc83ebc51c12828a958aba9c26561a780e7e832a1988d64987d807a489fd2bbd123457e85e2f159685a4be44939c92ee970608b64b347fe17d1c1d3113b37a007edfb51368054c5c3c2da3be8eed0a2cbe

ca5c634da7451865d5a41c08d7968fb67b41652a3a44920f1c7e4f979f1dc23c8e0db94b6e89b00cf8a42d11b514d073e5570e65d240a70c87041f6752ce4e11b6b59f221e55b1a1651d

Cassie stared at it. It looked more like a list of numbers than actual ciphered text.

“It’s hexadecimal,” said Phil.

Jake shot him a blank look.

“You know, hexadecimal. Base 16? How did you submit you embedded programming assignment without it?”

“Y-yeah, I know, I just feel a little stupid. I should have realised that.”

“Is this an assignment or something then?” asked Cassie.

“Nah, we don’t have any assignments due right now,” said Phil, “Dany’s taking an elective that I’m not doing, but I don’t think they’d deal with strings of hexadecimal numbers.”

Cassie knew Dany – Jake’s girlfriend – as well, but they weren't really friends. She was generally a bit loud, but pleasant to be around. She was a computer science student like Phil.

“Are you sure this is a cipher?” asked Phil.

Jake shrugged. “Dany said so.”

“Anyway, we’ll work on this independently and share notes, say, tomorrow? Or just text?”

“Just email it if you get the solution,” said Phil, “I mean, you’re going to have to crack that thing on a computer and email's more convenient. I’m going to start work on it after my nap. See you later then!”

Phil left. Cassie, too, left for her dorm room. She tried staring at the numbers a few times as she walked. The obvious first solution was ASCII in hexadecimal. It would be super easy to convert, because of the sheer number of online converters.

Cassie took her phone out and looked at the numbers again. Then it clicked. It couldn’t be ASCII. This wasn’t Cassie’s strong suite, but she did remember that ASCII used 7 binary digits. Ergo, it could go from 00000000 to 01111111 in binary. That would be 0-127, or in hexadecimal, 0 to 7F. Therefore, if it was ASCII, every letter in the 0th, 2nd, 4th, etc position would have to be 7 or less. That was obviously not true, as the very first character in the cipher was A, or 10.

Of course, the person who made this cipher could be insane enough to just string the seven-bit numbers end to end. Would that leave a tell? She would have to check that once she returned to her dorm room.

She reached her room. She showered, had more snacks, and finally opened her laptop. She decided to have a go at the cipher for a bit. She started it up.

The computer took a bit of time to start. In the meantime, Cassie tried thinking through the problem again. Surely, the most important thing to figure out would be the identity of the creator of the cipher. Their personality would give them a clue about it.

Another thing to consider would be purpose. Could it be criminal? Unlikely. Dany wasn’t the criminal type as far as Cassie knew, and it would make no sense to hand over the cipher to Jake if it involved anything criminal. Jake didn’t have the patience to crack a cipher, but to assume it would be safe with him was foolish. He was friends with Phil, and Phil was really good with computers. He would surely crack it.

Another possibility was that this was enciphered with something like the regular encryption used for data transmission and stuff. Cassie didn’t know too much about it, but she knew for sure that that they involved long keys that would be near impossible to bruteforce. Guessing it would be out of the question.

In the first place, would Dany be able to pull off something like that? Cassie knew the answer immediately. Dany was smart and good at maths. If she understood the theory, she could program it manually even if she didn't have access to a dedicated program for the job.

If that was the case, there was no way they were cracking the code. Dany would have realised that. This could still be a criminal matter.

If not, the code would still be hard to crack, but it would be doable.

What would she do if the code was impossible to crack? Could she hand over the code to law enforcement? It wasn’t like Cassie knew a lot about how law enforcement really worked in the first place. But if it came down to that, could she do that? She would be betraying Jake’s trust. She would be betraying Dany’s confidence in Jake. But hiding a criminal matter could cause more harm in the long run. People were capable of becoming generally worse, especially with no feedback telling them that that was the case. Besides, Cassie, who had never broken a law in her life, would be aiding and abetting a criminal.

The computer finished booting up. Cassie let out a deep sigh. She didn’t know whether the code was breakable yet. She had to figure out that first. If it wasn’t, well, she could worry about it later.



END OF CHAPTER ONE


Thank you for reading! Do let me know if you manage to crack the cipher (hint: It doesn't require a key). 

Read next chapter: chapter 2  |  chapter 3 | chapter 4

You can also follow me on Facebook here.

Until next time!

 

Saturday, 19 March 2022

Hard vs soft magic systems - Advantages and disadvantages

 

I've used both hard and soft magic systems, and this article is a summary of my thoughts on the matter as a writer.

To start with, definitions:

A hard magic system is a magic system where the rules of magic are defined. The audience can learn knows what a character can do with their magic, essentially (or you know what they can do). If they can use, say, fire, they will always use fire. Or they may be able to use multiple types of magic, but maybe they know a few fixed spells which do something that is well-defined. They might able to do something under specific conditions (i.e., a type of magic that only works on full moon days).

A soft magic system is the opposite. The rules are less defined, there are no concrete laws that the magic system has to follow, and so on. This is the type of situation where there is little to no explanation on how the magic works.  

Of course, this is a spectrum. You could push a hard magic system to a level where you can calculate the exact power levels (though maybe this would get boring). Or you could have a soft magic system where your character just uses magic of the sort necessary when the situation calls for it with no explanation other than the character being a magic user. You could also have basically every point in between. The balance you want here really depends on the type of story you want to write.

Let's start with hard magic systems, the type I tend to write the most.

Hard magic systems

The biggest advantage to me, here, is that hard magic systems introduce a level of structure to the story. Usually, when you're going for a fantasy setting, you end up throwing some limiters of a real-world setting out of the window. A hard magic system can help remedy this and help maintain some tension in the story.

For example, assume your character is someone who can manipulate memories, but the rest of the story is based in the real world or something analogous to it. By giving your character such a power, you've removed some constraints on them. For example, they might be able to get out of a certain situation (say, if they were stopped for speeding in a vehicle) via memory manipulation. However, by limiting their powers to memory manipulation, you've also limited what they can do significantly. They can't necessarily get out of  physical altercation using it. It works even better if there are limits to what your character can do. Say they can manipulate one person every ten minutes. This would force them to rely on their wits to buy time, or just run away, or avoid using their powers during some confrontations. If the effect wears off within a set time, your character may have to get out of there fast before they're caught.

Basically, letting the audience know (or deduce) what your character can and can't do in advance lets them be more invested in the story because it makes the stakes real. There's tension in the story if your character can't just wave a wand and get out of the situation. There can be a different kind of tension if your reader is internally screaming at your character to do something (say, solving a problem with creative application of their powers, which can only work if said powers are defined already).

This is why some level of hard magic system works best when many or all of your cast can use magic (depending on genre, of course). If you don't define what your characters can and can't do in such a situation, your setting, logically, would be going into a complete meltdown. Another possibility is you could end up with a story with no stakes because it feels like the writer tosses a coin every time they need to figure out the results of a conflict.

Hard magic systems can also be used to force creative problem solving from your characters. This is certainly possibly with a soft magic system, but if the rules are already established and your character works around them, it becomes infinitely more satisfying. It is much easier to create that lightbulb moment when the reader has an understanding of the possibilities.

However, it is also necessary to talk about the disadvantages of a hard magic system. A hard magic system can kill a little bit of the magic and wonder of the setting based on implementation, pushing the feel of the setting from fantasy to somewhat similar to sci-fi (I'm not saying it makes the setting sci-fi, I'm saying it can give your setting a similar feel). That's not necessarily a bad thing though.

Another potential issue is, again, depending on the complexity of your setting, you might need copious amounts of notes. This isn't necessary to start with (I am an incurable pantster myself, but I make up a lot of details as I go and iron it out later in editing), but if you have a lot of characters or a complex setting, it might be necessary to make notes about the what certain characters can and can't do. You might think you can remember all the details (and sometimes you can), but with multiple iterations of characters, it might become confusing really quickly. Besides, readers will notice inconsistencies, especially if they affect the plot in any way. 

Soft magic systems

Let's talk about soft magic systems.

These can be a bit more nebulous, a bit more ill-defined. But there are definite advantages to that, as this same nebulous nature can give your story a more fantasy-like feel. 

This also means soft magic systems can be useful if there are few characters who can use magic, and they appear rarely / use magic rarely. In this kind of situation, it serves two purposes. It helps maintain an air of mystery about the character that uses magic. You can also use a soft magic system to limit your magic user when they appear. Maybe they can't do a particular thing when they appear because, say, the stars are wrong. Whether that works or not depends entirely on the type of story and how closely your POV character knows the magic user (though it is entirely possible to pull this off if your POV character is the magic user). 

You can also shift the stakes from what the magic user will do to whether they will appear / help. Maybe they like to test the other characters. Maybe they're unwilling to interfere unless absolutely necessary. If your magic user's utility is unpredictable, it can make the entire situation unpredictable and therefore interesting.

You can also use a soft magic system in a situation that doesn't fit what was discussed so far, if the stakes in the story are not necessarily related to magic. An example of this would be a situation where the story is more about the relationship between characters and less about battles between magic users. In that case, every single important character could have ill-defined magic powers, but your main focus would be the relationships between characters or their day-to-day hijinks.

When you talk about the disadvantages, well, the biggest disadvantage is that a badly used soft magic system can kill the stakes of a story instantly, as discussed above. Think about it, if you have the type of story where all your characters use magic, how ridiculous would it be if the effectiveness of each party depends entirely on what the writer wants, with no way to predict it in advance?

In conclusion

The important thing to remember is that this is very much a spectrum. Where you want to be depends on the story you want to tell and frankly, what kind of magic system you want to use. 

However, I personally don't really think about this process when designing a setting or coming up with a story idea. What happens happens. Sure, I might tweak it one way or the other depending on the feel of the story and the type of plot I'm going for, but that's about it. 

That might not be how it works for you, but you can figure it out fairly intuitively once you actually start writing. You just have to figure out what works for you.


I hope this helped you gain some understanding about this topic. Please do tell me your thoughts in the comments, and if you have anything to add, please do so.


You can also follow me on Facebook here.

Until next time!

Sunday, 13 March 2022

The Coloured Barcode - Chapter 3 (Short story)

The group study session was in one of the study areas. Half the class was there already, as well as a few fourth years. Cassie's classmates, the third years, were busy studying. That was to be expected, as a lot of them were a bit stuck on a lot of things that would be in the exam. The fourth years, by the looks of it, were goofing off. The conversation about the advantages and disadvantages of MCQs with negative marking.

"Oh hello Cassie! did you already do these two problems?" asked Anna.

Cassie blinked twice. She had not seen those two particular questions in her life. Anna understood this right away.

"Nevermind, do it now. Lex, you told us you'll teach us about this."

"Hand me the book," said Cassie. It would be good practice if nothing else.

Lex, one of the fourth-years, sighed. "I already taught you this. Look, if you're that overworked, work on your project or something. It's due with the exam, right?"

"No, two days afterwards, plus it's not the same subject," said Jake, one of Cassie’s classmates.

Cassie jumped. "But I already submitted it! The deadline is tomorrow and I didn't want..."

"We got an extension," said Jake.

“You traitor! Why didn’t you tell me?”

Jake shrugged. “It wouldn’t matter to you anyway. What were going to do, run it through a spell check for a fiftieth time?”

Cassie bit back a retort. She could have checked her calculations again and maybe polished the conclusion.

"Wait, about the project, how did you wire the seven-segment display? Four digits is impossible, right?" asked Anna.

"Forget the project - we'll tackle that when we have to," said Jake, "First, Cassie, can you solve this?"

Cassie gave him her best death glare - she was working on the two problems that Anna gave her earlier. She was kept quite busy for some time, solving question after question. As expected, her friends pointed out things that she had almost overlooked. She had no time to think of the cipher, let alone work on it. 

The rest of the class also joined them one by one. Anna was forced to shut up about the project for the time being. The fourth years helped as well - they had an exam the next day, but apparently, it was easy, so they had time to spare.

Finally, they decided to break for dinner. As they got up, Anna turned to Cassie.

"Really, Cassie, how did you wire the seven-segment display?"

"Huh? Did you switch the anode or the cathode?"

"What's the anode and what's the cathode? Which one is connected to which number? Look, explain it to me over dinner. Please? Don't tell me to look it up on the internet - I tried, I honestly tried..."

Cassie rolled her eyes. "Of course you did. Get me a paper and a pen."

Cassie sketched it on the paper. She explained it as quickly as she could. Then she returned to her bag to pack her things. That was when she noticed the slip of paper containing the cipher in her bag. She pulled it out again and looked at what she had decoded.

01236 10643 50263 46310 056432 12 2165 36201 52036 10346 246530 325062 5126 63012 12 21 60431 50236 21 02356 

It was definitely base 7. The seven-segment display was essentially seven digits, aka, base seven. This was too good to be a coincidence. She looked at the first entry - 01236. It was not repeated as is, but the same numbers, 0, 1, 2, 3, and 6, were present three times in the code. Not one entry had duplicate numbers. Her theory could be right. She took a piece of paper, and sketched the result, with the numbers 0-6 representing the segments a-g of a seven-segment display.

 Cassie sketched the first digit. It was the segment on top, then the one on the top right, then the bottom right, then the bottom segment, and finally, the middle segment. What emerged was, unmistakably, a 3.

That was better than nothing, but what was a number supposed to mean? She moved on to the next digit. Slowly, a set of numbers emerged.

A set of numbers, 3, 2, 5, 2, 6, 1, 4, 3, 5, 2, 6, 6, 4, 3, 1, 1, 2, 5, 1, 5

What Cassie noticed, instantly, was that the numbers were 1-6. Now there were six numbers instead of seven, she was back to where she started. She couldn't think of anything it could possibly mean. This set of numbers had to be the result – this cipher was incredibly inefficient in terms of the number of characters it took to represent a single digit. 

There were twenty digits – too much for a credit card number, even with the security code attached. If one number was a dummy, it was a possibility, but you’d have to know which number the dummy was. There were too many digits for it to be an account number. Perhaps it was an account number followed by a transaction code or amount.

But would any of them use just 0-6? That would be an insane coincidence.

It could also be a password. She didn't know the admin password in the department's computer labs, but this might be it. But then again, she thought, it was unsafe and ridiculously difficult to remember. It could also be the serial number of a SIM, but why would you even bother sending it to someone in such an obvious cipher? What could you use it for in the first place?

She could go dumpster diving again and find more papers written in the same code, but it was likely too late to do that now. She returned to the study room, still thinking about it.

As she settled down, Anna entered the room. She sat down next to Cassie and picked up a book. Cassie looked at her. She was rifling through the textbook with no real aim in mind. She decided to ask Anna.

"Anna, what kind of number has 20 digits?"

Anna looked at Cassie like she had grown another head. "Come again?"

"What king of number has twenty digits?"

"pi to twenty digits? I know only 3.14 though."

"Seriously, I meant a number that can actually mean something to someone. Our student ID is 8 digits, for example. What kind of number has 20 digits?"

"20 consecutive tosses of a die?" asked Anna.

It took a few seconds for that to sink in. That was it! It was the results from some gambling operation. It was probably run by some students. Then again, she deleted that thought immediately. No one would trust a gambling ring where the results were based on the result of a die if they didn't witness someone tossing the aforementioned die. If they were present, chances were, they'd write it down or take a video of it.

"Cassie, are you aright? I thought you were happy for a second, and then, immediately, you were like, oh, I'm out of battery, where is my charging port. Are your circuits actually fried?"

"Anna, I swear, if you call me a robot one more time, I will toss you out of that window over there."

"That's like, a metre off the ground."

"I'm not trying to murder you. I'm simply trying to be in a different room."

"What are you two arguing about?"

That was one of the fourth years, Bella.

"Cassie wants to know what a twenty-digit number could be," supplied Anna.

"A password created by a robot, a twenty-digit prime number used for encryption, like a key, but then 20 numerical digits is way too short," said Bella, "why?"

"Answers to an MCQ with 20 questions. Or would it be a, b, c, and d? Technically you could convert it to numbers." It sounded like a disembodied voice that sounded remarkably like one of their classmates, Jake. On closer inspection, it appeared to come from behind the bags.

"Yeah, then the numbers would have to be zero to four," said Cassie.

"Then show us the thing you're talking about," said Bella, "you obviously have a specific twenty-digit number in mind."

Anna was a simple airhead, Jake was a prankster, and Bella was a fairly normal nerd. None of them could be involved with the creation of a potentially criminal document. She showed them the paper.

"Hold on, I've seen these numbers before," said Bella, "I can't remember where, really, wait, what did you say, Jake, some time ago?"

"I have been silent for the past..." started Jake but was interrupted by Bella.

"MCQ! It's the answers for the freaking Econ MCQ! Where on earth did you find this, Cassie?"

"MCQ? Wait, what? It's not criminal? Are you sure?"

Anna chimed in. “Wait, you have six answers in an MCQ?”

Bella ignored her. "Where did you find it? Cassie, this could be serious. This could be serious academic misconduct. Where did you find it?"

"I - uh, I have a photo, give me a minute," said Cassie, quickly pulling it up on her phone. 

Was it just MCQ answers? No, that was not possible. She did not pour so much of her heart and soul into finding the answers to an MCQ. It was supposed to be something criminal. True, it was written on the back of a set of printed slides, which in hindsight, looked like econ notes. On the other hand, econ notes didn’t make something not criminal. There was hope yet.

"I knew it!" said Bella, "this is an econ note alright. Wait, where was this written?"

Cassie explained how she broke the code to her. Cassie's head was in a whirl. This could not be. As she was explaining this, Lex walked in. He listened in silence until the explanation finished.

"You actually broke the code? I thought that impossible. That's precisely why I threw it in the bin."

Bella turned and glared at him. Cassie’s heart sank. There was no way Lex would do anything criminal.

"Let me guess. You finished what you could of the paper, you were bored, you didn't want to submit the paper as it was, so you created a cipher just because you could to buy time to go over the paper with a fresh perspective before you handed it in," said Cassie.

"Great deduction," said Lex, "Well, done, detective Cassie."

Cassie blushed. Maybe it was worth it after all.

"Why, thank you!"

 


This is the final installment of this particular story. I hope you enjoyed it. Stay tuned for more of Cassie's adventures (hijinks?).

You can read Chapter 1 here and chapter 2 here.



This is the second edition of the story, the first is on Wattpad :)

You can also follow me on Facebook here.

Until next time!

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...