On a clear night last September, at a little Ontario airport, two pilots, two scientists, and an engineer took off in a small plane. They'd pulled the left-side door off its hinges, and a telescope poked out of the portal—not at the night sky, but at the ground below. The team was about to play a very difficult, very windy game of catch.

A couple miles away, their colleagues gathered in a trailer to lob the tiny baseballs: infrared photons, beamed from a laser that tracked the plane along its mile-high trajectory. In the craft cruising above, physics graduate student Chris Pugh and the others pivoted their telescope to catch the photons, one by one. On their best run, they caught over 800,000 photons in just a few minutes, but it wasn't easy. “Out of every 10,000 photons they sent, we’d get one,” says Pugh, who studies at the University of Waterloo. “One to a hundred of them.”

The point of this high-altitude game was to test a technology known as quantum cryptography. For decades, experts have claimed that if executed properly, quantum cryptography will be more secure than any encryption technique used today. They also say it will be one of the lines of defense when quantum computers crack every existing algorithm. But it's hard to pull off; quantum cryptography requires precise control of individual photons over a long distance. Pugh's group was the first to successfully test the technology from ground to airplane.

It works like this: The sender transmits carefully prepared photons, over optical fiber or through the air, to a recipient. The recipient reads the photons like Morse code, with physical signals corresponding to a letter or a number. Instead of listening for long and short beeps, Pugh and his colleagues measured how the photons are oriented—what physicists call polarization. In their setup, photons could be polarized in four directions, and the team translated that polarization into 1’s and 0’s: a binary message known as a cryptographic key. Using that key, a sender can encrypt their information, and only a recipient with the key can unscramble the message.

Quantum cryptography is so powerful because it's physically impossible for a hacker to steal a key encoded using quantum particles. In the quantum world, when you measure or observe a particle, you change it. It’s like Schrodinger’s cat, which is both dead and alive when you’re not looking, but immediately becomes one or the other when you look. If you try to measure a quantum key, you immediately change it—and by design, the sender will know and throw the key out. “It’s secure by the laws of nature,” says physicist Thomas Jennewein, who led the work at the University of Waterloo.

Commercial quantum cryptography products have been around for over 15 years, but they have limited range. "You can guarantee security between the White House and the Pentagon, or from the corner of one military base to another," says Caleb Christensen, the chief scientist at MagiQ Technologies, a Boston-area company that makes commercial quantum cryptography systems. "In the telecom business, that's way too short." So far people have been able to send quantum keys just 250 miles.

This tech will be important when computers become too powerful for current encryption algorithms. It takes today's computers far longer than the age of the universe to decode an encrypted message, but it’ll be a cinch for quantum computers. “It might take hours or days as opposed to age of the universe,” says Pugh.

Still, quantum cryptography won't be tech's security savior. Most hacks today are due to simple human error. “Most times when a corporation gets hacked, it’s not necessarily because someone went in and spliced into their telephone line,” says Christensen. “If you lose all your secrets because someone phishes the e-mail of your middle management, you’re not going to spend millions of dollars installing a quantum cryptography backbone.”

For those with higher security standards, the eventual goal is to deliver quantum keys to a satellite, which could make it possible to send quantum-secured messages across the globe. Last August, the Chinese Academy of Sciences, collaborating with Austrian physicists, launched a satellite called Quantum Experiments at Space Scale, although they haven’t successfully sent it a key.

Jennewein's team has been rehearsing for a satellite mission for over three years. In 2013, they started by sending quantum keys to a moving truck. Now that they've shown they can transmit enough quantum signal through a mile of Earth's atmosphere, Jennewein wants to beam a key 300 miles into the air, to a satellite in low-Earth orbit. With proper funding, Jennewein thinks his team could do it in two or three years. He's optimistic: “The airplane experiment is, in some respects, harder than an actual satellite,” he says. “A satellite has much smoother and more predictable motion than an aircraft.” Just ask Pugh.