Novels2Search
The Spymaster's Apprentice
10: ​Letter Frequencies and Pigpens

10: ​Letter Frequencies and Pigpens

CHAPTER 10: LETTER FREQUENCIES AND PIGPENS

Ean sat across from Samuel in the back room of the Argonian Bookshelf. He pulled the spy's message from his satchel and showed it to his mentor.

Pigpen cipher message [https://assets.zyrosite.com/mk3DgWba85TD9V6y/chapter-10-pigpen-cipher-message-d95pJxWL4WIxDelb.png]

"What kind of message is this? It's a bunch of squiggles and dots. No letters. No numbers. If the doodles weren't in a line and repeat in some places, I would have mistaken this message for a child's scribbles. Is this another form of substitution cipher?" asked Ean.

Samuel looked downright gleeful, his eyes sparkling with excitement. "Indeed it is. The fact that it doesn't resemble a written message at all is precisely the point. Those symbols are substitutes for letters."

Ean's frown deepened as he studied the symbols, his fingers tapping a restless rhythm on the table. His voice filled with increasing frustration. "So, without any clue as to which letter each of these represents, how exactly am I supposed to decipher this?"

Samuel leaned forward, a knowing smile playing on his lips. "Oh, a brute force approach would work, but it would take you hours." He paused, his gaze piercing Ean's. "And a more complex cipher could take weeks, even months to crack." His eyes sparkled with excitement. "Unless, of course, you know a few tricks to outsmart the cipher."

Ean's eyes lit up. The old spymaster was about to reveal another secret that would help him rank up his class skills. "Tricks? What kind of tricks are you talking about?"

Samuel's smile widened, a glint of mischief in his eyes. His voice was low and conspiratorial, while also being giddy. "The spymaster's ultimate secret weapon." He looked at Ean with anticipation, cupped his hands around his mouth and whispered, "Letter frequency and word probabilities."

Scratching his head, Ean asked "What are those?" Eager to learn, yet struggling to grasp the cryptic concepts.

Patiently, Samuel explained, "Not all letters are used in equal combination in our language. Did you know if you counted all the letters in any book, the twelve most commonly used letters would spell ETAOIN SHRDLU?"

Bewildered, Ean responded, "I did not... because I do not know what those words mean. It sounds like a magical spell."

"It is magical, in a way. By doing a letter frequency analysis of an encrypted message, you can guess what the twelve most commonly used letters are by matching them to the letters in ETAOIN SHRDLU. From that, you can then make guesses about entire words." Samuel's eyes shone, enjoying the challenge of imparting his knowledge.

Ean pondered this for a moment. "That makes sense. I can think of lots of words that use those letters. But how does that help break the cipher faster?"

"You identify the most commonly used letters, numbers or characters in the message. Then based on their location within a word, you make an educated guess which letters it would be. For example, when you see a three-letter word. The most commonly used three-letter words are 'the' and 'and'. Ask yourself, does it make sense that the last letter might be an E or that the first letter might be an A?"

Ean eyes widened. "I am beginning to understand. By making a few educated choices, you can reduce the possible cipher combinations from 26 down to 4 or 5."

Samuel smiled in approval. "Very good." He scribbled out an encoded message from memory. "I've encoded a short message with the Caesar Cipher using a different offset. Use Letter Frequency Analysis to see if you can work out what the offset is." He slid the message across the table, the scrambled letters beckoning Ean to decipher their meaning.

KYZJ ZJ R JVTIVK DVJJRXV

"Let's see. The letter J appears seven times so I'm guessing it's the letter E." Ean took two slips of parchment and wrote the alphabet on each. He then aligned the J of the second alphabet with the E of the first alphabet.

QFK: Using the information in the Activity Page, see if you can decipher Samuel's message using frequency analysis and guesswork.

KYZJ ZJ R JVTIVK DVJJRXV

"Nope. That decrypts into nonsense. Let's see, the second letter of ETAOIN SHRDLU is a T." He lined up the T with E.

Same result.

He worked his way through the letters of ETAOIN and looked at Samuel with skeptical eyes. "Are you sure you encoded this correctly?"

"Like I said, they're the twelve most common and you still have the letters of SHRDLU to get through."

"Knowing you, it's a trick and the J represents the last letter, U." Ean laid out the two alphabets again, only to fail again.

"No short cuts apprentice."

If you spot this tale on Amazon, know that it has been stolen. Report the violation.

Ean sighed and aligned the S with the J. Everything fell into place. "This is a secret message."

Samuel chuckled. "It's not a secret anymore. You just might make a spymaster after all."

LOG ENTRY ADDED: Spycraft - Letter Frequency Analysis

SKILL UNLOCKED: Letter Frequency Analysis (1/3)

CLASS RANK INCREASED: Spymaster +1 (6/6)

+ + + CLASS LEVEL UP: Spymaster Rank 3 + + +

Increased encryption & decryption speed, intuitive letter frequency calculation, enhanced subterfuge, improved countersurveillance

After successfully decoding the message, Ean's excitement and enthusiasm for the trade of spycraft had grown. Now he had a way to decrypt messages when he didn't know the cipher used.

Samuel watched the young spymaster with an amused look. "It does me good to see your excitement for the job," he said. "However, I can save you a lot of time and effort. Your spy in Argonia North wrote this message using the Pigpen Cipher, named because the shapes resemble pig pens."

LOG ENTRY UPDATED: Spycraft – Ciphers

QFK: Use the Activity Page for the Pigpen Cipher, decrypt the message left for Ean.

Pigpen cipher message [https://assets.zyrosite.com/mk3DgWba85TD9V6y/chapter-10-pigpen-cipher-message-d95pJxWL4WIxDelb.png]

NOTE: The downloadable Activity Pages booklets has a link to this font. https://www.neuralsplyce.com/free-stuff

Blinking in surprise, Ean said "Now the shapes make sense. Give me a moment to decode the message." He took out the parchment and studied the strange symbols with new understanding. After a few minutes of analysis, he looked up at Samuel. "The spy says the protesters are outsiders... and he wants to meet in person," Ean reported. "The last line seems unnecessary, 'It is a time of troubles.'

Samuel's expression turned serious. "Meetings are the most dangerous activity a spy or spymaster can perform. The last thing they want to do is expose their identity to the wrong person. That's the purpose of the last line. It's a passphrase. They'll 'challenge' you with something innocuous like asking what the time is. When you respond with the passphrase, they know you're who they are supposed to meet."

LOG ENTRY ADDED: Spycraft - Challenges and Passphrases

"I feel like I should wear a cloak and carry a dagger. What if it's not a trap? Why would they risk exposing themselves except to double-cross me?"

If it's not a trap, it means they have urgent information that would take too long to pass by message. The choice is yours."

Ean considered the risks carefully. Being killed was not desirable. Getting captured and tortured, in his imagination, was less desirable than death. He had a duty to fulfill and a quest to complete so his decision was obvious.

"We are at the brink of war. I must take the risk and meet the spy," he declared with quiet resolve. A sliver of unease crept into his thoughts at the dangers of such an encounter, yet the needs of his kingdom demanded bold action in response to this unexpected development.

Decrypted_Message-07 added to Inventory

QUEST COMPLETED: Q-018 Decipher Encrypted_Message-07

Reward: +1 XP (12/12)

SKILL UNLOCKED: Pigpen Cipher (1/3)

LOG ENTRY UPDATED: Spycraft - Ciphers

QUEST ACCEPTED: Q-019 Meet with the Argonia North spy

# # # CHARACTER LEVEL UP # # #

Gain increased Endurance, Intellect, and Charisma

Personal Stats

Name: Ean Fleming Level: 4

Experience Points (XP): 12/12

Points to next level: 12

Gold Pieces: 23

Active Quests: 3

Completed Quests: 16

Failed Quests: 0

CLASS: Spymaster Rank: 3

Reverse The Word (2/3)

Caesar Cipher II (1/3)

Atbash Cipher (2/3)

Numbers For Letters I (0/3)

Letter Frequency Analysis (1/3)

Pigpen Cipher (1/3)

* * *

As Ean ventured into the Riverside park, his resolve wavered with each step. Doubts gnawed at him, whispering that this could be a trap, a deceptive ploy to lure him into danger like the wolves in Argonia West. The thought of facing a far more perilous threat than he had anticipated left him questioning his own abilities.

"Relax. I'm not in any danger," he muttered, his voice betraying a tremor he couldn't quite suppress. Tension coiled in his neck, and he rubbed the area in a futile attempt to ease it. "I'm being paranoid for no reason," he reassured himself.

As a well-dressed man changed direction to approach, Ean's stress levels spiked. The man moved with a purposeful stride, exactly the image Ean had of a spy.

"Pardon me, but can you tell me what time it is?" the man inquired politely.

Ean paused, his heart racing. "It is a time of troubles," he uttered, his voice tinged with a cryptic undertone.

The man's face darkened. "I need the time, not useless commentary on the world," he snapped before storming off.

Ean's face flushed red. How had he misjudged the encounter so thoroughly?

Moments later, a harried-looking woman approached Ean, her arms laden with baskets of groceries.

"Sorry to bother you, but do you know what time it is?" she asked, while shifting her grip on one of her baskets.

Ean hesitated. Two people asking for the time seemed suspicious, but it was a busy time of the day, and she looked like a harried housewife. The last thing she needed was some oddball wasting her time with a nonsensical response.

"Yeah, I think it's—." He noticed a seriousness in her eyes. They were in constant motion, scanning her field of view for threats. Her stance wasn't as casual as it appeared. Feet spread and right arm coiled to use the basket like a cudgel. This woman was prepared for a fight.

With a subtle nod, he proclaimed in a low, steady tone, "It is a time of troubles," echoing the cryptic words he had spoken earlier.

To his surprise, the woman's tense expression melted away, replaced by a sense of relief. She relaxed her posture and sank down onto a nearby park bench, her eyes revealing a deep sadness.

"Thanks for meeting me," she whispered. "Your master was a good friend and a great spymaster. I miss him dearly."

Another surprise, if it was true. "We didn't have much time. I'm surprised he didn't mention you," Ean replied, still dubious of her identity.

"Our job is to keep secrets, even from those closest to us. Like you, I was recruited and trained by him. He spoke highly of you and was excited to train you. I can only imagine the pressure you're under, especially with all the turmoil and rumors swirling around," she said.

"That's why I agreed to this meeting. The king needs answers fast about what's happening here."

She leaned forward and dropped her voice to a hushed whisper, her gaze darting around the park. "People on both sides of the border gates are agitated. My assessment is they will soon turn violent. The war in the shadows already has and now my life is in danger."

Ean's heart skipped a beat. "Turned violent, how? What danger are you in?"

The woman's voice dropped to a conspiratorial whisper. "What I'm about to tell you could be considered treason," she said. She took a deep breath and exhaled slowly.

"I... discovered the Brindle spy stationed here." She wrung her hands while engaged in a mental debate before blurting out, "We met, fell in love, and married in secret."