Crew members of the USS Pueblo are led into captivity after the vessel was seized by North Korean patrol boats in the Sea of Japan on Jan. 23, 1968. (AP)

Back when North Korea was in the business of attacking the United States and not just making colorful but empty threats, the rogue state launched an audacious mission to capture an American spy ship, kidnap its crew, and steal lots of cryptologic goodies.

It was a success.

On Jan. 23, 1968, in an attack overshadowed by Vietnam and all the other drama yet to unfold in that chaotic year, the USS Pueblo was attacked in the Sea of Japan by North Korean torpedo boats. The vessel was captured. So were more than 80 crew members, held almost a year.

The attack was a major propaganda coup for North Korea — the tough, whip smart American military embarrassed by a smaller, technologically inferior navy.

Beyond embarrassment, the United States also suffered a staggering loss of intel know-how and equipment.

“The loss that resulted from the subsequent compromise of classified material aboard the ship would dwarf anything in previous U.S. cryptologic history,” according to a highly secret National Security Agency report released in 2012. “It also gave the North Koreans and no doubt the Soviets a rare view of the complex technology behind U.S. cryptographic systems.”

Though the Pueblo crew tried to destroy the goods before capture, they were largely unsuccessful. An unclassified CIA analysis in 2015 said “80 percent of document holdings and 95 percent of cryptologic equipment” had “survived the ship’s hurried, chaotic emergency destruction effort.”

The front page of The Washington Post after North Korea seized the USS Pueblo in 1968.

But the North Koreans still had to figure out how to work it all.

For that, there was an interrogation — brutal, hours-long sessions.

“We were held for 11 months and beaten every day, humiliated, starved, just about anything you could think of,” Tom Massie, one of the former crew members, told The Post in 2016.

The NSA report described the North Korean approach.

At first, the proceedings were tame. Crew members got their own rooms. Their health needs were taken care of.

“A North Korean Army doctor and nurse were available twenty-four hours a day to provide medical care and treatment for the Pueblo’s crew,” the NSA report said. “The doctor performed physical examinations on all the crew at one time or another and treated colds, sore throats, ear infections, sprains, athlete’s foot, and skin disease.”

Then the interrogations began.

The NSA report listed the techniques:

Making crew members walk around the floor on their knees.

Making crew members hold chairs over their heads for long periods of time.

Forcing the crew to sit in straight chairs at attention for lengthy periods.

Requiring crew members to get down on their knees with their backs straight and lean backward for hours with a 2 X 4 piece of wood placed between their thighs and calves.

Exploiting the element of fear by creating noises in an adjoining room which sounded as though other crew members were being killed.

Slapping and punching crewmen or hitting them with gun butts.

Holding a gun to crewmen’s heads with threats to kill.

Telling crew members that they might as well confess because the North Koreans had captured everything anyway and that the U.S. government had tricked the crew.

Informing the crew that they would be shot as spies if they did not confess.

Exactly what the North Koreans were able to learn is redacted in the NSA report, although it states “the North Koreans obtained a significant amount of highly classified information from the interrogation of Pueblo crew members.”

The situation was described as a “worst case circumstance.”

Intelligence officials feared and presumed the information flowed to the Soviet Union.

What became clear in the weeks and months after the attack is that the crew did not have the protection it needed — a problem that also befell a U.S. spy plane shot down by the North Koreans in April 1969.

The Pueblo had just two machine guns. There were no ships or friendly aircraft nearby.

As they attacked, the North Koreans sent the following signal: “Heave to or I will open fire.”

The Pueblo had no choice.

“It was,” the NSA report said, “the first such surrender of a U.S. Navy ship since the War of 1812.”

Read more Retropolis:

In Trump’s North Korea warnings, his military school classmates hear echoes of the 1962 Cuban missile crisis

Gen. MacArthur witnessed Trump-style ‘fire and fury’ in Korea, and it sickened him

Before North Korea had nuclear missiles, it had wild and often deadly plots

Cataclysmic cargo: The hunt for four missing nuclear bombs after a B-52 crash

What if the president ordering a nuclear attack isn’t sane? A major lost his job for asking.