The basement of Building One at Pearl Harbor reeks of sweat, cigarette smoke, and desperation. It’s April 18th, 1942, and Commander Joseph Rochefort paces between rows of cramped desks where exhausted Navy cryptanalysts hunch over sheets covered in five-digit number groups. Every man in this room knows they’re losing the war. The Japanese naval code JN-25 sits before them like an impenetrable fortress. For 18 months, America’s best mathematicians have thrown themselves against this cipher. And for 18 months, they failed. The numbers mock them. 35,000 possible code groups. Each one representing a word, a phrase, a ship name, or a location. Even if you crack the code groups, they’re then disguised by additive tables that change every few weeks. It’s a code wrapped inside a cipher, and it’s killing American sailors.”

image

“In the four months since Pearl Harbor, Japanese forces have steamrolled across the Pacific. Wake Island: fallen. Guam: fallen. The Philippines on the verge of collapse. American submarines hunt blindly through empty ocean while Japanese carriers strike with surgical precision. The kill ratio is devastating. For every Japanese ship sunk, America loses three. Admiral Nimitz needs to know where the enemy fleet will strike next. But the intelligence officers can only shrug and point to vast stretches of blue on the map.”

“What Rochefort doesn’t know, what nobody in that basement knows on this humid Hawaiian morning, is that the breakthrough they desperately need will 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 will come from a kid who shouldn’t even be in the building: a 17-year-old who lied his way into the Navy with a forged birth certificate and a voice that keeps cracking at the worst possible moments. His name is Andrew Mate Gleason. And in six weeks, his obsessive tinkering with what everyone else dismisses as noise will unlock JN-25. His method will expose the location of the Japanese fleet, enable America’s greatest naval victory, and save thousands of American lives. But first, he has to convince a room full of officers that a teenager with no formal training in cryptography has spotted something that the experts have been missing for over a year. The clock is ticking. The Japanese are planning something big. And nobody’s listening to the kid.”

To understand why JN-25 seemed unbreakable, you have to understand its terrifying elegance. The Japanese Navy introduced this cipher system on June 1st, 1939, specifically designed to resist Western cryptanalysis. Unlike simpler codes that substitute letters for letters, JN-25 operates in two brutal stages.

First, Japanese messages are encoded using a massive code book containing 33,000 five-digit code groups. The word “battleship” might become 15347. “Tomorrow” might be 90281. Locations, names, ship designations, operational commands—all converted to anonymous numbers. Even if you intercept a message, you’re staring at strings like 15347-28914-42139-87655 that mean absolutely nothing without the code book.

But the Japanese didn’t stop there. They knew that if Americans captured one of their code books—which happened in December 1940 when the British seized German papers from a captured ship—the entire system would collapse. So they added a second layer: additive encryption. Before transmission, operators add random five-digit numbers from separate additive tables to each code group. Now 15347 becomes 49201 or 91348 or any of billions of possible combinations. And those additive tables changed every few weeks, sometimes every few days.

The numbers are devastating. Even with captured equipment and six months of messages, Agnes Driscoll—the Navy’s legendary “Madame X,” who had broken previous Japanese codes—made virtually no progress. By early 1942, OP-20-G could read perhaps 1% of intercepted JN-25 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’d 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 U.S. Fleet, was losing patience. “Gentlemen,” he told naval intelligence officers in March 1942, “the Japanese are running circles around us. 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 JN-25, 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 U.S. Navy into a decisive trap. Those plans were being transmitted daily in JN-25 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.

The stakes extended beyond military defeat. Every day the code remained unbroken, American submarines hunted blindly. Transport convoys sailed without knowing Japanese carrier positions. Commanders made decisions based on guesswork. Men died because America was fighting deaf and blind.

Captain Lawrence Safford, the father of Navy cryptanalysis, told colleagues that breaking JN-25 might be mathematically impossible. “The problem space is simply too large,” he said. “We’re looking for patterns in pure randomness. The additives ensure we’ll never see the same encryption twice. Even if we had infinite time and infinite computing power, there’s no guarantee we’d break it.”

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 Mate Gleason was born November 4th, 1924, in Fresno, California, 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, D.C., 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 in the adventure serials. But it was a start.

For two months, he 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. And 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 has been sorting messages for ten weeks when he notices something impossible. It’s 2:00 a.m., and he’s supposed to be asleep, but instead he’s in the cryptanalysis room with permission from the night duty officer—a young ensign who doesn’t care what the kid does as long as he doesn’t bother anyone.

Andrew spreads out sixty intercepted messages across an empty desk. They are all from the same Japanese transmission station, all sent during March. Standard procedure says 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’s been noticing that certain messages—sent from Tokyo to Berlin—have letter indicators (metadata at the beginning of the transmission) that only use the first thirteen letters of the alphabet. And messages from Berlin to Tokyo only use the last thirteen letters. It’s barely noticeable. Nobody’s mentioned it in any of the analysis reports he’s filed.

He grabs a pencil. What if—and this seems crazy—what if the unencrypted indicators follow the same pattern? What if Tokyo-to-Berlin headers use only A through M in plain text, and Berlin-to-Tokyo uses N through Z? If that’s true, and if you know 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 have part of the additive table, you can start peeling back the encryption on the actual message content.

Andrew works through the math. His hands shake slightly. It’s such a stupid, simple idea. Surely the real cryptanalysts have thought of this. But he checks the analysis logs. Nothing. Nobody’s following this thread.

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

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

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

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

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

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

“Gleason, 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’ve 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 returns to his desk, notebook in hand. The breakthrough sits there, 73% validated, and nobody wants to hear it. In his notes, he writes, “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 keeps his discovery to himself. He refines it, tests it on more messages, improves his accuracy to 81%. He develops statistical tests to validate his recovered additives. The method works. He knows it works. But nobody will listen to a seventeen-year-old message sorter.

Then, on May 11th, 1942, everything changes.

Admiral Nimitz arrives at Building One for an emergency briefing. Japanese radio traffic has exploded. Something big is coming. Rochefort’s team knows it’s a major offensive, but they can’t pinpoint where. The partially broken intercepts mention a location designated “AF.” Is it Alaska? Australia? The Aleutians? They’re flying blind.

In the briefing room, tension crackles like static electricity. Rochefort presents what little they know.

“We’re reading maybe five percent of current JN-25 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 stares 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 stands up.

He doesn’t mean to. His body just moves. Every rule of military protocol says he should sit down and shut up. He’s the lowest-ranked person in the room. But the words come out.

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

The room erupts. Officers shout over each other. Who the hell is this kid? How did a seaman apprentice get into a classified briefing? Rochefort looks like he’s aged ten years in ten seconds.

“Gleason, sit down,” Angstrom hisses.

“But I’ve been testing a method—”

“Gleason, sit down.”

Nimitz holds up a hand. The room falls silent. “Let him speak.”

Andrew’s mouth goes dry. He’s never spoken to an admiral before. He can feel every eye boring into him. His voice cracks as he starts.

“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, leans forward. “Wait. Say that again about the alphabet split.”

Andrew repeats it, faster now, more confident. He shows his notebook. The math spills out. Pattern recognition, frequency analysis, statistical validation. It’s crude compared to the elegant theories the Yale mathematicians use, but it’s concrete. It’s testable. It works.

Dyer grabs the notebook, scans it, and his eyes widen. “Joe, look at this. The kid might be on to something.”

Marshall Hall Jr. crowds in. So does Agnes Driscoll. They pass the notebook around, checking calculations, testing assumptions. The room divides instantly. Half the officers think this is absurd, a waste of time from an unqualified child. The other half sees what Andrew sees: a crack in the fortress wall.

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

“It’s not a hunch,” Dyer counters. “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 looks at Andrew. Really looks at him for the first time. “Gleason, how old are you? Really?”

The room goes quiet. Andrew feels his forged birth certificate burning a hole in his file somewhere. “Nineteen, sir.”

“Uh-huh. And I’m the Queen of England.” Rochefort turns to Nimitz. “Sir, I don’t care if he’s twelve. If this method works, it might give us the breakthrough we need.”

Nimitz studies Andrew for a long moment, then he nods. “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 doesn’t finish the sentence. He doesn’t need to.

“CTA One: If you’re fascinated by the untold stories of World War II heroes who changed history, hit that subscribe button. We upload new documentaries every week exploring the people and moments that shaped our world. Don’t miss the next one.”

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

Driscoll handles him roughly at first. She’s broken Japanese, German, and Italian codes. She doesn’t suffer fools, and she especially doesn’t suffer teenage boys who think they’ve discovered something everyone else missed. But as they work through intercept after intercept, her attitude shifts. The method works. More than that, it’s faster than anything they’ve tried.

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

Nimitz gets the intelligence brief on May 14th, 1942: the location, the timing, the force composition—everything he needs to plan an ambush. He sends three carriers—EnterpriseHornet, and Yorktown, barely repaired from earlier battles—to position themselves northeast of Midway. The Japanese don’t know they’re walking into a trap. But the intelligence keeps coming, and it’s Andrew’s method that’s unlocking it.

By May 27th, OP-20-G is reading 40% of current JN-25 traffic. An unprecedented breakthrough. They identify the Japanese carrier divisions: AkagiKagaSoryuHiryu. The flagship commanders. The attack timeline. Even the morning of June 4th gets confirmation when decoded intercepts reveal Japanese pilots being briefed for dawn strikes on Midway’s airfield.

On June 4th, 1942, at 10:26 a.m., dive bombers from Enterprise and Yorktown catch three Japanese carriers with their decks full of armed and fueled aircraft. In five minutes, AkagiKaga, and Soryu are burning wrecks. Hiryu launches a counter-strike that cripples Yorktown, but American bombers find her in the afternoon. By sunset, four Japanese fleet carriers are sinking. Japan loses 248 aircraft, 3,057 men, and its best carrier pilots.

The Battle of Midway isn’t just a victory. It’s the turning point of the Pacific War. Before Midway, Japan held the initiative, choosing when and where to strike. After Midway, they’re 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.

After Midway, OP-20-G becomes an intelligence factory. Andrew’s indicator-subtraction method evolves into a comprehensive system for attacking additive tables. The team develops mechanical aids—early IBM tabulators adapted for cryptanalysis. By August 1942, they’re reading 60% of JN-25 traffic. By October, 75%. The intelligence saves thousands of lives.

On August 24th, 1942, decoded JN-25 traffic reveals Japanese plans to land reinforcements at Guadalcanal. American naval forces intercept them at the Battle of the Eastern Solomons. The Japanese lose a light carrier and dozens of transport ships.

On October 26th, advanced warning from JN-25 decrypts allows American carriers to ambush a Japanese task force at Santa Cruz. The kill ratios flip. In 1941, Japan sank three American ships for every one they lost. By late 1942, America is sinking two Japanese ships for every one lost.

Submarine warfare transforms completely. U.S. submarines, equipped with decoded Japanese convoy routes, begin a campaign of systematic destruction. In 1941, American submarines sank 180,000 tons of Japanese merchant shipping. In 1943, armed with JN-25 intelligence, they sink 1.5 million tons. Japan’s economy strangles. Oil from the Dutch East Indies can’t reach Japanese refineries. Troops in New Guinea and the Philippines run short of food and ammunition. All because American submarines know exactly where the convoys will be.

Even the Japanese notice. A captured diary from a Japanese naval officer recovered in late 1943 reads: “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—all 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 U.S. 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 JN-25. 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.”

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.

“CTA Number Two: This is the kind of history they don’t teach in school. Real people making impossible decisions under incredible pressure. If you’re enjoying this, hit the like button and share it with someone who loves military history. And check out our video on the Battle of Midway to see how this intelligence changed everything.”

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 JN-25, 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 JN-25 so long they couldn’t see past their assumptions.”

The numbers tell the story better than words. Before Andrew Gleason’s indicator breakthrough in May 1942, OP-20-G could read 5% of current JN-25 traffic. After implementing his method, that jumped to 40% within weeks and 75% by year’s end. Historians estimate the JN-25 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 JN-25. 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 JN-25 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.

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.