Swap and Meld

key exchange — two parties build a shared secret over an open channel; each combines a private value with a public one and swaps results, then re-combines, arriving at the same key an eavesdropper who saw every message still cannot reproduce

Press play to listen along. The line being read lights up as you go.

Show full transcript

Loading transcript…

01 Opening
Swap and Meld beat 1 of 5

Swap sat on a crate in the drafty bell tower, his knees pulled up to his chin. The wind off the river smelled of salt and wet coal, blowing through the open arches. Below him, the city of CipherForge stretched out like a messy gray grid under the morning fog. On the far side, past the black water, the tall towers of the Gray Agency loomed like silent giants. He adjusted his heavy copper headphones, listening to the static that sounded like dry leaves scraping across stone.

"Meld, do you copy?" Swap whispered into the heavy brass microphone, leaning closer to the transmitter.

Miles away, in the damp basement of an abandoned fish market, Meld adjusted her own dial. She could hear the low hum of the river through the floorboards, shaking the empty wooden crates around her.

"I hear you, Swap," she said, her voice tight with frustration. "But so does everyone else."

That was the problem. The academy’s open radio was a public channel, meaning every word they spoke bounced off the stone walls of the valley. The Gray Agency’s listening posts across the river recorded every single breath they took.

They needed to scramble their messages with a secret key, which was a private number only the two of them knew. But how do you agree on a secret when your worst enemy is listening to every word you say?

"We can't just say the key out loud," Swap radioed, tapping his fingers against his knee. "The Grays will write it down before we even finish speaking."

"And we can't meet to whisper it," Meld replied, staring at the cold, dark water dripping from the ceiling. "That defeats the whole purpose of the mission."

It felt completely impossible. It was like trying to pass a secret note across a crowded classroom where the teacher reads every single message aloud. A secret you had to build in front of your enemy seemed like no secret at all.

02 Swap and Meld
Swap and Meld beat 2 of 5

The next morning, their instructor called them into the basement workshop, which smelled of turpentine, linseed oil, and old paper. The instructor was a retired cryptographer with paint-stained fingers and sharp, twinkling eyes. She stood behind a long wooden workbench, where two large, identical buckets of bright yellow paint sat side by side.

"You two look like you've been chewing on glass," the instructor said, wiping her hands on a gray rag.

"We can't send a key," Meld said, setting her heavy satchel down on a stool. "The radio is completely compromised."

The instructor smiled, tapping one of the yellow buckets with a wooden stick. "Yellow is public," she said, "so shout it from the rooftops because the Gray Agency can have all the yellow they want."

She reached into a locked wooden cabinet behind her and pulled out two smaller, sealed cans with a soft click.

"This is where we start our *key exchange*," the instructor said, setting the cans on the table. "Each of you will pick one private color, and you must tell absolutely nobody what it is, not even each other."

Swap grinned, his eyes lighting up as he reached out and grabbed a can labeled Prussian Blue. He quickly hid it behind his back, grinning like a thief.

Meld hesitated, then chose a can of Crimson Red and tucked it under her heavy coat.

"Now," the instructor said, handing them each a wooden stir stick. "Mix your private color into your public yellow," the instructor said, "and then swap your buckets over the open radio."

"Let the Gray Agency watch you carry them across the bridge because it won't help them at all."

Swap opened his blue paint and poured a generous splash into his yellow bucket. The bright yellow swirled, then darkened into a rich, forest green as he stirred until the color was perfectly smooth.

Across the table, Meld poured her red into the second yellow bucket, watching the paint blend into a warm, vibrant orange.

"Go on," the instructor urged, pointing toward the door. "Swap them."

Swap carried his green bucket out into the cold morning air, while Meld carried her orange bucket from the opposite direction. They met right in the middle of the stone bridge, in plain view of the Gray Agency's tall copper towers. Swap handed Meld his green paint, and Meld handed Swap her orange paint. They didn't whisper or try to hide, but simply traded buckets and walked back to the workshop.

"The Grays saw everything," Meld said as she walked back inside, her brow furrowed. "They saw the yellow, the green, and the orange," Meld said, "so they have all of that."

"Exactly," the instructor said, "but they don't have your private blue, and they don't have her private red."

03 Swap and Meld
Swap and Meld beat 3 of 5

"Now for the trick," the instructor said, her eyes twinkling with excitement. "Fold your own private color into the bucket you just received."

Meld looked at the green bucket Swap had given her, which was a mixture of public yellow and Swap’s secret blue. She opened her private can of red and slowly poured the thick paint into the green mixture. She began to stir, watching the bright green and deep red swirl together, darkening rapidly into a thick, muddy brown.

Swap did the same, taking Meld's orange bucket and pouring his private blue paint directly into the warm mixture. He spun his wooden stick, watching the colors merge as the orange and blue swirled, shifted, and finally settled.

"No way," Swap whispered, holding his bucket up next to Meld's.

The colors matched perfectly, and both buckets now held the exact same shade of muddy brown.

"That brown is your key," the instructor said, tapping the edge of the workbench. "You built it together, out loud, in front of everyone, and the Gray Agency cannot make it."

Meld stared into the dark paint, her mind racing as she tried to find a flaw in the logic.

"But they saw the green," Meld said, pointing a paint-covered finger. "And they saw the orange, so why can't they just mix those?"

"Because green and orange make a completely different color," the instructor explained. "To get this exact brown, you need the original yellow, the blue, and the red."

"But the blue and the red were never sent across the bridge," Swap added, catching on.

"They'd have to un-mix the paint," Meld realized, her eyes widening. "They would have to take the green bucket and pull the blue out of it."

"Exactly," the instructor said. "And you can stir paint together in a heartbeat, but no one alive can stir it apart."

Swap let out a sharp laugh, because the sheer simplicity of the trick made him want to dance. It was a one-way street, where mixing was easy but separating was entirely impossible.

"It's a one-way trick," Swap said, his voice bouncing off the brick walls. "We broadcast everything in the open, but the secret only lives in our buckets."

04 Swap and Meld
Swap and Meld beat 4 of 5

"But we can't send paint through the radio," Meld said, her practical nature taking over. "How does this work with messages?"

The instructor wiped her hands on her apron and walked over to the large blackboard, picking up a piece of chalk.

"The same way," she said, "but instead of paint, we use numbers and a special kind of math that only goes one way."

She wrote a large number on the board: *17*.

"This is our public base," she said, "so everyone knows it, including the Grays, but now you must choose your private numbers."

Swap chose *5, writing it on a scrap of paper and folding it tightly, while Meld chose 7* and hid it under her hand.

"Now," the instructor said, "we raise our base to the power of our secret number, then divide by another public number and keep the remainder."

"It's like a mathematical blender," the instructor explained, drawing a circle on the board. "It is easy to mix the numbers up, but if you only see the result, it is almost impossible to guess the starting numbers."

Swap did his math quickly on a slate, mixing in his private *5 to get a result of 12*.

"I'm broadcasting twelve!" Swap shouted, pretending to hold a heavy radio microphone.

Meld did her math, mixing in her private *7 to get a result of 9*.

"Broadcasting nine," she said, smiling slightly at his excitement.

They swapped their results over the table, and Swap took Meld's *9 and mixed his private 5 into it. Meld took Swap's 12 and mixed her private 7* into it, and they both calculated furiously as their chalk scratched against their slates.

"Three," Swap said, showing his slate.

"Three," Meld agreed, holding up hers.

The numbers matched perfectly, and the instructor, playing the part of the enemy spy, stood at the side of the room with a notepad.

"I have all your public broadcasts," she said, mimicking a grumpy Gray agent. "But I cannot get to your three because I don't have the five or the seven."

Swap grinned. "So we broadcast everything," he said, "the public color, both mixed buckets, all of it."

"And the secret still only lives in the two of us, because we never sent our private colors."

It was beautiful, and the magic of the one-way math meant two agents could build one shared key entirely in the open.

05 Closing
Swap and Meld beat 5 of 5

That night, the real mission began in the freezing dark.

Swap wrapped his woolen scarf tighter around his neck as he sat in the drafty bell tower, looking down at the black river. He turned the heavy brass dial of his radio transmitter, feeling the copper coils hum warmly against his cold fingers.

"Meld, this is Swap," he said into the microphone. "Do you copy?"

In the damp shipyard basement, Meld adjusted her heavy headphones, breathing in the smell of old fish and wet wood.

"I copy, Swap," she whispered. "The Grays are listening, and I can hear their carrier signal buzzing on the line."

"Let's give them something to listen to," Swap said, his heart beating fast with excitement.

They began the protocol, speaking clearly to let their voices carry across the river to the Gray Agency's listening posts.

"Public base is nine," Swap announced.

"Understood," Meld replied. "Using nine."

Then, they went silent as Swap picked his private number, choosing a prime number he had memorized from his training manuals. He did the math on a scrap of paper, his hand shaking slightly in the cold, and found his remainder.

"My mix is four," Swap radioed.

Meld did her own calculations in the dark basement. "My mix is seven," she replied.

They swapped their numbers over the open air, and Swap could almost picture the Gray agents frantically scribbling "four" and "seven" into their ledgers. The Grays had the public nine, the four, and the seven, but they didn't have the secret ingredients.

Swap took Meld's seven and folded his private number into it, while Meld took his four and folded her private number into it. They both calculated the final step, and Swap stared at the single digit on his paper, holding his breath.

"Ready?" Meld's voice came through the static.

"Ready," Swap said.

They didn't say the final number out loud because they didn't need to, since they both held the exact same key.

Using that secret number, Swap began to scramble his message, turning his report into a jumble of meaningless letters. He tapped the key, sending the scrambled text across the airwaves where it sounded like complete gibberish to anyone else.

But to Meld, who held the exact same key, the letters fell perfectly into place, and she read his report easily.

The mission was a success, and a light, buzzing delight crept into Meld's chest, replacing the morning's hopelessness. It was the particular joy of a problem that had seemed airtight suddenly springing wide open from one clever angle.

She keyed her transmitter, and just to be cheeky, she sent a final message in plain text, right where the Gray Agency could read it.

"Good evening, gentlemen," she said.

Then, she and Swap went quiet on their shared secret. They were two agents a city apart, warmed by the same private key. They grinned at the beautiful trick of a secret you can shout into the open air. They kept it entirely, wonderfully to themselves.

The CipherForge ensemble

Swap and Meld is part of CipherForge's distributed-narrative cast. Each character embodies a different curricular primitive; together they teach the full subject.