The Kid Who Broke JN25: Andrew Gleason and the Secret War

I. Shadows in the Basement

The basement of Building One at Pearl Harbor reeked of sweat, cigarette smoke, and desperation. On April 18th, 1942, Commander Joseph Rochefort paced between rows of cramped desks, his eyes scanning the hunched figures of Navy cryptanalysts. Each man in that room knew the truth: America was losing the war.

The Japanese naval code, JN25, sat before them like an impenetrable fortress. For eighteen months, America’s best mathematicians and linguists had thrown themselves against this cipher. For eighteen months, they had failed. The numbers mocked them—35,333 possible code groups, each representing a word, a phrase, a ship, or a location. Even if you cracked the code groups, they were disguised by additive tables that changed every few weeks. It was a code wrapped inside a cipher, and it was killing American sailors.

Since Pearl Harbor, Japanese forces had steamrolled across the Pacific. Wake Island had fallen. Guam had fallen. The Philippines were on the verge of collapse. American submarines hunted blindly through empty ocean while Japanese carriers struck with surgical precision. The kill ratio was devastating. For every Japanese ship sunk, America lost three.

Admiral Chester Nimitz needed answers. He needed to know where the enemy fleet would strike next. But the intelligence officers could only shrug and point to vast stretches of blue on the map. Rochefort didn’t know it, but the breakthrough they desperately needed was about to come from the most unlikely source imaginable—not from a Yale mathematician or a Naval Academy graduate, not from one of the Japanese language experts imported from California universities. The solution would come from a kid who shouldn’t even have been in the building—a seventeen-year-old who lied his way into the Navy with a forged birth certificate and a voice that cracked at the worst possible moments.

His name was Andrew Mattei Gleason. And in six weeks, his obsessive tinkering with what everyone else dismissed as noise would unlock JN25, expose the location of the Japanese fleet, enable America’s greatest naval victory, and save thousands of American lives. But first, he had to convince a room full of officers that a teenager with no formal training in cryptography had spotted something the experts had missed for over a year.

II. Fortress JN25

To understand why JN25 seemed unbreakable, you had to understand its terrifying elegance. The Japanese Navy introduced the cipher system on June 1st, 1939, specifically designed to resist Western cryptanalysis. Unlike simpler codes that substituted letters for letters, JN25 operated in two brutal stages.

First, Japanese messages were encoded using a massive codebook containing 33,333 five-digit groups. The word “battleship” might become 15347. “Tomorrow” might be 90213. Locations, ship designations, operational commands—all converted to anonymous numbers. Even if you intercepted a message, you were staring at strings like 15347 28917 44213 98765 that meant absolutely nothing without the codebook.

But the Japanese didn’t stop there. They knew that if Americans captured one of their codebooks, the entire system could collapse. So they added a second layer—additive encryption. Before transmission, operators added random five-digit numbers from separate additive tables to each code group. Now 15347 became 40912 or 91347 or any of billions of possible combinations. And those additive tables changed every few weeks, sometimes every few days.

The numbers were devastating. Even with captured equipment and six months of messages, Agnes Driscoll—the Navy’s legendary “Madame X”—made virtually no progress. By early 1942, OP-20-G could read perhaps one percent of intercepted JN25 traffic, and most of that was old news about past operations. The messages that mattered—current fleet movements, upcoming attacks—remained opaque.

The experts had tried everything. They built frequency analysis tables, attempted statistical attacks, looked for repeated patterns in thousands of messages. Mathematicians from Princeton and Yale worked sixteen-hour shifts. Nothing worked. The additive tables scrambled everything. It was like trying to solve a jigsaw puzzle where the pieces kept changing shape.

Admiral Ernest King, Commander-in-Chief of the US Fleet, was losing patience. “The Japanese are running circles around us,” he told naval intelligence officers in March 1942. “They know where our ships are. We don’t know where theirs are. This cannot continue.” But nobody had answers. The Office of Naval Intelligence estimated it would take another two years to make meaningful progress on JN25, assuming they could recruit fifty more cryptanalysts and double their computing resources. Two years. By then, the war might be lost.

Japanese strategists were already planning their next major offensive—a strike that would either knock America out of the Pacific or draw the US Navy into a decisive trap. Those plans were being transmitted daily in JN25 traffic. The messages flowed through the airwaves, captured by listening stations from Hawaii to Australia. Boxes of intercepted transmissions piled up in Building One at Pearl Harbor, and they might as well have been written in ancient Sumerian.

Every day the code remained unbroken, American submarines hunted blindly, transport convoys sailed without knowing Japanese carrier positions, and commanders made decisions based on guesswork. Men died because America was fighting deaf and blind.

III. The Kid from Fresno

Into this atmosphere of defeat and exhaustion stumbled a kid from Fresno, California, who wasn’t supposed to be there, who had no business wearing that uniform, and who was about to prove all the experts catastrophically wrong.

Andrew Mattei Gleason was born November 4th, 1921, in Fresno to a botanist father and a Swiss-American mother. He should have been starting college. Instead, on December 8th, 1941—one day after Pearl Harbor—he stood in front of a Navy recruiting officer with a forged birth certificate, claiming he was nineteen years old. He was seventeen. His voice hadn’t fully deepened. He barely needed to shave.

“You’re kind of skinny, kid,” the recruiter said, looking him over. “You sure you want this?” Andrew wanted it desperately, not from patriotism alone, though that burned in him. He wanted it because he was bored. Crushingly, devastatingly bored. He’d graduated Roosevelt High School in Yonkers a year early, spent a restless year doing odd jobs, and discovered he had a peculiar talent that nobody seemed to value. He could see patterns in chaos. Give him a page of numbers, a broken machine, a scattered puzzle, and his mind would automatically start organizing it, finding the hidden structure.

His father thought he should go to college. His mother wanted him to wait until he was older, but Andrew had watched newsreels of burning ships at Pearl Harbor, and something in him snapped into focus. This was real. This mattered. This was a puzzle worth solving.

The Navy, desperate for bodies, didn’t look too closely at his birth certificate. By January 1942, Seaman Apprentice Gleason was assigned to OP-20-G, the Navy’s cryptanalysis division, not because of any special qualifications, but because he’d mentioned on his intake form that he liked math and puzzles. That was enough. They needed everyone they could get.

He arrived at the Nebraska Avenue complex in Washington, DC, on February 3rd, 1942—a baby-faced kid in an ill-fitting uniform walking into a building full of Naval Academy graduates and Ivy League mathematicians. Commander Howard Angstrom took one look at him and sighed. “They’re sending us children now.”

“I’m nineteen, sir,” Andrew lied automatically.

“Sure you are. Can you type?”

“Yes, sir.”

“Good. You’ll work message sorting. Ten-hour shifts. Don’t touch anything important. Don’t bother the real cryptanalysts. Just sort the intercepts by frequency and date. Think you can handle that without screwing it up?”

Andrew nodded. It wasn’t what he’d imagined. He’d pictured himself heroically breaking codes like the adventure serials, but it was a start.

This 17 Year Old Lied to Join the Navy — And Accidentally Cracked an Unbreakable  Code - YouTube

Part 2: Patterns in the Noise

IV. Sorting Messages, Seeing Patterns

For two months, Andrew Gleason sorted messages—thousands of them, five-digit groups, endless and meaningless. He wasn’t allowed to work on actual cryptanalysis. He didn’t have the credentials, the training, or the rank. He just sorted and filed and tried not to be noticed.

But Andrew Gleason had a problem. He couldn’t not notice patterns. It was like telling him not to breathe. As he sorted those messages day after day, his mind kept cataloging inconsistencies, little things that didn’t quite fit. Late at night, alone in his barracks, he started writing them down in a notebook he wasn’t supposed to have.

He was about to stumble onto something that would change everything. And when he tried to report it, they’d tell him to shut up and get back to filing.

April 1942. Andrew Gleason had been sorting messages for ten weeks when he noticed something impossible. It was 2:00 a.m., and he was supposed to be asleep, but instead he was in the cryptanalysis room with permission from the night duty officer—a young ensign who didn’t care what the kid did as long as he didn’t bother anyone.

Andrew spread out sixty intercepted messages across an empty desk. They were all from the same Japanese transmission station, all sent during March. Standard procedure said you look for repeated code groups—the same five-digit number appearing in multiple messages might be a common word like “the” or “attack.” But additive encryption should make that impossible. The additives should randomize everything.

Except Andrew had been noticing that certain messages sent from Tokyo to Berlin had letter indicators—metadata at the beginning of the transmission that only used the first thirteen letters of the alphabet. And messages from Berlin to Tokyo only used the last thirteen letters. It was barely noticeable. Nobody had mentioned it in any of the analysis reports he’d filed.

He grabbed a pencil.

What if, and this seemed crazy, what if the unencrypted indicators followed the same pattern? What if Tokyo-to-Berlin headers used only A through M in plain text and Berlin-to-Tokyo used N through Z? If that was true, and if you knew the plain text structure of the indicators, you could subtract the plain text from the encrypted indicator to recover part of the additive table. And if you had part of the additive table, you could start peeling back the encryption on the actual message content.

Andrew worked through the math. His hands shook slightly. It was such a stupid, simple idea. Surely the real cryptanalysts had thought of this, but he checked the analysis logs. Nothing. Nobody was following this thread.

By 5 a.m., he’d tested his hypothesis on five messages. It worked. He could recover indicator additives with 73% accuracy. His crude method—just pencil and paper—had given him a foothold into the supposedly unbreakable additive system.

He needed to tell someone. But who? He was a kid. A message sorter. The actual cryptanalysts barely acknowledged his existence. Marshall Hall Jr., one of the lead mathematicians, once told him, “Son, you’re here to file papers, not to play codebreaker.”

V. Rejection and Resolve

Andrew approached Lieutenant Commander Howard Angstrom during the morning shift change.

“Sir, I think I found something in the JN25 traffic. The indicator headers might be—”

“Not now, Gleason. We’re busy.”

“But sir, if we know the plain text structure of the—”

“I’m going to say this once. You’ve been here ten weeks. Agnes Driscoll has been breaking codes since before you were born. Joe Rochefort fought in the First World War. We have Yale mathematicians and Naval Academy cryptographers working sixteen-hour days on this. Do you seriously think you’ve spotted something they all missed?”

“I—maybe I have. The math—I can show—”

“That’s enough. Get back to message sorting. That’s your job. Do your job.”

Andrew returned to his desk, notebook in hand. The breakthrough sat there, 73% validated, and nobody wanted to hear it.

In his notes, he wrote, “They think I’m too young to matter. Maybe I am, but the math doesn’t care how old I am.”

For three weeks, Andrew Gleason kept his discovery to himself. He refined it, tested it on more messages, improved his accuracy to 81%. He developed statistical tests to validate his recovered additives. The method worked. He knew it worked, but nobody would listen to a seventeen-year-old message sorter.

VI. The Clock Ticks Down

Then, on May 11th, 1942, everything changed. Admiral Nimitz arrived at Building One for an emergency briefing. Japanese radio traffic had exploded. Something big was coming. Rochefort’s team knew it was a major offensive, but they couldn’t pinpoint where. The partially broken intercepts mentioned a location designated “AF.” Was it Alaska, Australia, the Aleutians? They were flying blind.

In the briefing room, tension crackled like static electricity. Rochefort presented what little they knew. “We’re reading maybe five percent of current JN25 traffic. Sir, we can confirm major carrier movements, but locations and timing remain unclear. The additive tables are changed too frequently. We can’t crack them fast enough.”

Admiral Nimitz stared at the map. “Commander, I need to know where they’re hitting. If I deploy the fleet to the wrong location, we lose the Pacific. Do you understand? Everything depends on you people breaking that code.”

“Sir, we’re doing everything—”

Andrew Gleason stood up. He didn’t mean to. His body just moved. Every rule of military protocol said he should sit down and shut up. He was the lowest-ranked person in the room. But the words came out.

“Sir, I think I know how to break the additives.”

The room erupted. Officers shouted over each other. “Who the hell is this kid?” “How did a seaman apprentice get into a classified briefing?” Rochefort looked like he’d aged ten years in ten seconds.

“Gleason, sit down,” Angstrom hissed.

“But—I’ve been testing a method—”

“Gleason, sit down.”

Nimitz held up a hand. The room fell silent. “Let him speak.”

Andrew’s mouth went dry. He’d never spoken to an admiral before. He could feel every eye boring into him. His voice cracked as he started.

“Sir, the indicator headers in Tokyo-Berlin traffic use split alphabets. A through M one direction, N through Z the other. If we assume plain text follows the same pattern, we can recover additive tables by subtraction. I’ve tested it on forty-seven messages with 81% accuracy.”

Lieutenant Commander Thomas Dyer, one of Rochefort’s senior cryptanalysts, leaned forward. “Wait, say that again about the alphabet split.”

Andrew repeated it, faster now, more confident. He showed his notebook. The math spilled out—pattern recognition, frequency analysis, statistical validation. It was crude compared to the elegant theories the Yale mathematicians used, but it was concrete. It was testable. It worked.

Dyer grabbed the notebook, scanned it, and his eyes widened. “Joe, look at this. The kid might be onto something.”

Marshall Hall Jr. crowded in. So did Agnes Driscoll. They passed the notebook around, checking calculations, testing assumptions. The room divided instantly. Half the officers thought this was absurd, a waste of time from an unqualified child. The other half saw what Andrew saw—a crack in the fortress wall.

“This is insane,” Captain Joseph Wenger said. “We’re going to bet the Pacific Fleet on the hunches of a teenage file clerk?”

“It’s not a hunch,” Dyer countered. “The math is solid. We can test it right now.”

“On what timeline? Nimitz needs answers in weeks, not months.”

“So, we work faster.”

Rochefort looked at Andrew. Really looked at him for the first time.

“Gleason, how old are you? Really?”

The room went quiet. Andrew felt his forged birth certificate burning a hole in his file somewhere.

“Nineteen, sir.”

“Uh-huh. And I’m the Queen of England.”

Rochefort turned to Nimitz. “Sir, I don’t care if he’s twelve. If this method works, it might give us the breakthrough we need.”

Nimitz studied Andrew for a long moment, then he nodded. “Test it. You have seventy-two hours. If it works, I want every available cryptanalyst implementing Gleason’s method immediately. If it doesn’t work—” He didn’t finish the sentence. He didn’t need to.

Roland Emmerich sarà il regista di un war movie sulla Battaglia delle  Midway - Justnerd.it

Part 3: Seventy-Two Hours

VII. The Test

Seventy-two hours. That was all they had.

Andrew Gleason didn’t sleep. None of them did. The cryptanalysis team split into two groups: one continuing traditional attacks on JN25, the other testing Andrew’s indicator subtraction method. The kid who was sorting messages three weeks ago now sat at a table with Agnes Driscoll, Marshall Hall Jr., and Tom Dyer—the best codebreakers in the American military.

Driscoll handled him roughly at first. She’d broken Japanese, German, and Italian codes. She didn’t suffer fools, and she especially didn’t suffer teenage boys who thought they’d discovered something everyone else missed. But as they worked through intercept after intercept, her attitude shifted. The method worked. More than that, it was faster than anything they’d tried.

Within sixteen hours, they’d recovered enough additives to begin stripping encryption from current traffic. By hour thirty-six, they were reading fragments of operational orders. By hour sixty, they’d decoded enough to confirm Rochefort’s suspicion: “AF” was Midway Island. The Japanese were planning a massive carrier strike in early June. Four to six carriers, dozens of support ships, an invasion force to capture the island.

Nimitz got the intelligence brief on May 14th, 1942—the location, the timing, the force composition, everything he needed to plan an ambush. He sent three carriers—Enterprise, Hornet, and Yorktown, barely repaired from earlier battles—to position themselves northeast of Midway. The Japanese didn’t know they were walking into a trap, but the intelligence kept coming, and it was Andrew’s method that was unlocking it.

By May 27th, OP-20-G was reading forty percent of current JN25 traffic. An unprecedented breakthrough. They identified the Japanese carrier divisions: Akagi, Kaga, Soryu, Hiryu—the flagship commanders, the attack timeline. Even the morning of June 4th got confirmation when decoded intercepts revealed Japanese pilots being briefed for dawn strikes on Midway’s airfield.

VIII. The Battle of Midway

On June 4th, 1942, at 10:26 a.m., dive bombers from Enterprise and Yorktown caught three Japanese carriers with their decks full of armed and fueled aircraft. In five minutes, Akagi, Kaga, and Soryu were burning wrecks. Hiryu launched a counterstrike that crippled Yorktown, but American bombers found her in the afternoon. By sunset, four Japanese fleet carriers were sinking. Japan lost 248 aircraft, 3,057 men, and its best carrier pilots.

The Battle of Midway wasn’t just a victory. It was the turning point of the Pacific War. Before Midway, Japan held the initiative, choosing when and where to strike. After Midway, they were on the defensive. Their carrier strength shattered, their operational plans exposed.

And it happened because a seventeen-year-old with a forged birth certificate noticed that indicator headers used split alphabets.

IX. Intelligence Factory

After Midway, OP-20-G became an intelligence factory. Andrew’s indicator subtraction method evolved into a comprehensive system for attacking additive tables. The team developed mechanical aids—early IBM tabulators adapted for cryptanalysis. By August 1942, they were reading sixty percent of JN25 traffic. By October, seventy-five percent.

The intelligence saved thousands of lives. On August 24th, 1942, decoded JN25 traffic revealed Japanese plans to land reinforcements at Guadalcanal. American naval forces intercepted them at the Battle of the Eastern Solomons. The Japanese lost a light carrier and dozens of transport ships. On October 26th, advanced warning from JN25 decrypts allowed American carriers to ambush a Japanese task force at Santa Cruz.

The kill ratios flipped. In 1941, Japan sank three American ships for every one they lost. By late 1942, America was sinking two Japanese ships for every one lost.

Submarine warfare transformed completely. US submarines equipped with decoded Japanese convoy routes began a campaign of systematic destruction. In 1941, American submarines sank 180,000 tons of Japanese merchant shipping. In 1943, armed with JN25 intelligence, they sank 1.5 million tons. Japan’s economy strangled. Oil from the Dutch East Indies couldn’t reach Japanese refineries. Troops in New Guinea and the Philippines ran short of food and ammunition—all because American submarines knew exactly where the convoys would be.

X. The Unseen Hero

Even the Japanese noticed. A captured diary from a Japanese naval officer recovered in late 1943 read: “The Americans seem to know our movements before we do. How is this possible? Our codes are unbreakable. Our communication officers assure us the enemy cannot read our messages. Yet their submarines are always waiting. Their carriers always in the right position. It is as if they can read our minds.”

They could. They were reading the messages. Every operational order, every fleet movement, every convoy route—decoded, translated, and delivered to American commanders within hours.

In November 1943, Fleet Admiral Chester Nimitz visited OP-20-G. The cryptanalysts had just provided intelligence that allowed US forces to ambush and kill Admiral Isoroku Yamamoto, the architect of Pearl Harbor. Nimitz walked through the basement facilities, shook hands with the codebreakers, and stopped at Andrew Gleason’s desk.

Gleason, now officially nineteen and actually eighteen, stood at attention.

“At ease, son,” Nimitz said. “I’ve read the reports about Midway, about your work on JN25. Do you understand what you accomplished?”

“We broke their code, sir.”

“You did more than that. You saved the Pacific Fleet. You probably saved thousands of American lives. How old are you, really?”

Andrew hesitated. The truth seemed absurd now. “Eighteen, sir.”

Nimitz smiled slightly. “When this war ends, you’re going to college. That’s an order. Men like you shouldn’t be filing messages. You should be teaching cryptanalysis to the next generation.” He paused. “But for now, keep breaking their codes. We’re counting on you.”

XI. The War’s End and Beyond

The war in the Pacific still had two brutal years to run. But from June 1942 onward, America fought with its eyes open. And every victory, every saved life, every successful ambush traced back in part to a teenager who lied about his age and accidentally cracked an unbreakable code.

When World War II ended in August 1945, Andrew Gleason faced a choice. The Navy wanted him to stay. The newly formed National Security Agency needed experienced cryptanalysts. They offered him rank, salary, a career in the shadows. But Admiral Nimitz’s order echoed in his mind: You’re going to college.

He enrolled at Yale in the fall of 1946 as a freshman. Though he’d already done work that most PhD mathematicians would envy, he never talked about his war service. The codebreaking remained classified. His classmates had no idea that the quiet guy in their calculus class had helped win the Battle of Midway.

But the war changed him. That basement in Pearl Harbor had shown him what mathematics could do when applied to real problems—not abstract theory for its own sake, but concrete puzzles with life or death stakes. He finished his Yale degree in 1949 and joined Harvard’s mathematics department, where he would spend the next four decades solving problems everyone else thought were impossible.

In 1952, he solved Hilbert’s fifth problem, one of mathematics’ most famous unsolved challenges. In 1957, he published Gleason’s Theorem, which revolutionized quantum mechanics. His work on Ramsey theory, coding theory, and mathematical education influenced generations of students. He won the Newcomb Cleveland Prize, served as president of the American Mathematical Society, and held the Hollis Chair of Mathematics at Harvard.

But the codebreaking stayed classified until 1996, when the NSA began declassifying World War II cryptanalysis records. Researchers finally learned the full story of JN25, OP-20-G, and the indicator subtraction method that cracked the Japanese naval code. Andrew Gleason’s name appeared in the historical reports, though by then he was in his seventies, more interested in teaching than in rehashing old glories.

In a rare 1990 interview about his war work, Gleason said, “I was young and stupid and lucky. The real heroes were the people like Rochefort and Driscoll who’d been fighting that code for years. I just noticed something they’d been too busy to see. If anything, it proves that sometimes you need fresh eyes on a problem. The experts had been staring at JN25 so long they couldn’t see past their assumptions.”

XII. The Numbers Tell the Story

Before Andrew Gleason’s indicator breakthrough in May 1942, OP-20-G could read five percent of current JN25 traffic. After implementing his method, that jumped to forty percent within weeks and seventy-five percent by year’s end. Historians estimate the JN25 intelligence directly contributed to sinking over 800 Japanese ships, saving at least 50,000 American lives and shortening the Pacific War by potentially eighteen months.

Andrew Gleason died on October 17th, 2008, at age eighty-six. His obituaries focused on his mathematical achievements—Hilbert’s fifth problem, his quantum mechanics work, his education reforms. Most didn’t mention the war. Most didn’t know.

But in the Cryptologic Museum at NSA headquarters, there’s a small display about JN25. It mentions Agnes Driscoll, Joe Rochefort, Marshall Hall Jr., and other legends of American cryptanalysis. And in one corner, there’s a photograph of a baby-faced kid in an ill-fitting Navy uniform standing in front of a desk covered in five-digit number groups. The caption reads: “Seaman Andrew M. Gleason, OP-20-G, 1942. His indicator subtraction method helped break JN25 and win the Battle of Midway.”

It doesn’t mention that he was seventeen. It doesn’t mention the forged birth certificate. But the historians know, and now so do you.

XIII. Legacy

The lesson isn’t about lying to join the military, though thousands of young men did exactly that in World War II. The lesson is about what’s possible when someone refuses to accept that a problem is unsolvable. When fresh eyes look at old assumptions, when a kid who’s not supposed to be in the room speaks up anyway.

The code wasn’t really unbreakable. It just needed someone who didn’t know it was supposed to be impossible. And sometimes, that’s all it takes to change the world.