In cryptography, gardening is the practice of deliberately causing an opponent to send messages that contain a specific, known piece of text, so that this known plaintext can be used to help break their encryption. Gardening works by shaping events or spreading information, such as a fake report or rumor, so that the target is forced to communicate about it, giving cryptanalysts a predictable string to search for in intercepted messages.
One of the most famous real examples happened in World War II, when U.S. codebreakers suspected the Japanese target “AF” was the island of Midway. They told Midway to radio a plain-text complaint about a water shortage, then intercepted a Japanese encrypted message that said “AF is short of water.” That single engineered phrase confirmed AF as Midway and helped enable the decisive American victory at the Battle of Midway.
What is gardening in cryptography?
Gardening in cryptography is a form of known-plaintext attack that relies on influencing the enemy’s behavior rather than passively waiting for useful messages. In a classic known-plaintext attack, the analyst already has both the encrypted text (ciphertext) and some part of the underlying original message (plaintext). With gardening, the analyst actively creates a situation where they can predict part of the plaintext before the enemy ever sends it.
Historically, gardening was used against manual and early machine ciphers such as the German Enigma system and Japanese naval codes. The idea was simple but powerful. If you could make the enemy radio something you chose, or at least strongly predicted, then you could feed that known piece into your codebreaking machinery. Even a short, engineered string, like coordinates of a known minefield or a specific phrase, could dramatically reduce the search space of possible keys and settings.
In essence, gardening turns cryptanalysis from a purely mathematical puzzle into an information operation that mixes codebreaking with deception, intelligence, and psychology.
In modern cryptography, the conceptual successor is the chosen-plaintext attack, where a system is considered secure only if it remains safe even when an adversary can choose arbitrary plaintexts to be encrypted. Gardening is the historical, real-world version of provoking such plaintexts, long before those ideas were formalized in security proofs.
How did gardening work against systems like Enigma?
During World War II, Allied cryptanalysts working at Bletchley Park and other codebreaking centers faced ciphers like the German Enigma, which changed its settings daily and had an astronomical number of possible configurations. Brute forcing every possibility was not feasible, so they relied on cribs, that is, educated guesses about pieces of plaintext inside specific intercepted messages. Gardening was a way to manufacture those cribs.
One tactic was to manipulate the battlefield or radio routines so that German operators would send predictable messages. For example, Allied forces could lay a minefield at known coordinates in such a way that German naval units would be forced to notice and report it. When an encrypted message about minefield coordinates was intercepted, codebreakers could assume those coordinates appeared somewhere in the plaintext. They would then test Enigma settings until a decrypted candidate produced that coordinate string in the right place. This quickly eliminated vast numbers of wrong configurations.
Bletchley Park also took advantage of routine communications. Weather stations, for instance, sent standardized weather reports at regular times with known formats. Cryptanalysts anticipated these and used them as cribs for the daily Enigma keys. Gardening took it further by not just relying on regularity, but by provoking specific content. According to historians of Bletchley Park, minefield and convoy reports were sometimes deliberately engineered to maximize their value as cribs, then “mined” by Turing’s bombes and other analytic methods.
The key idea was that if you know even a few words or numbers inside an encrypted message, you can test possible keys by asking: “Do we get those words where we expect them?” Gardening created those words on demand.
Fiction has picked up on this tactic as well. In Neal Stephenson’s novel Cryptonomicon, a character in the jungle plants rumors about a figure called “The Crocodile” specifically so the enemy will be forced to transmit messages containing that phrase, echoing historical gardening strategies.

How was gardening used at the Battle of Midway?
The Battle of Midway in June 1942 is one of the clearest textbook examples of gardening used in real cryptographic warfare. U.S. Navy cryptanalysts at Station Hypo in Hawaii had partially broken a Japanese naval code called JN-25, but they still faced gaps and ambiguities. One major uncertainty was the identity of a target labeled only as “AF” in Japanese planning messages. Analysts suspected AF was Midway Atoll, but they needed proof.
According to U.S. Naval Intelligence accounts, the team devised a simple but brilliant gardening trick. They instructed the American garrison on Midway to broadcast an unencrypted message reporting that the island’s water distillation plant had failed and that they were short on fresh water. Shortly afterward, Japanese encrypted communications were intercepted that stated, in essence, that “AF is short of water.” Since only Midway had been told to complain about water, this confirmed that AF referred to Midway.
This confirmation unlocked a flood of intelligence. Once AF was known to be Midway, analysts could interpret other intercepted plans more accurately, revealing not just the target but also the approximate timing and composition of the Japanese attack force. Historical analyses by the U.S. Naval War College attribute a significant part of the American strategic advantage at Midway to this combination of codebreaking and clever information operations.
In cryptographic terms, the Midway episode is a classic gardening example: American forces created a specific, predictable piece of plaintext (“water shortage at Midway”) then watched for its appearance in enemy encrypted traffic. When it appeared under the code name AF, that engineered known plaintext gave them the mapping between the symbol and the real-world location. The actual math of breaking JN-25 was complex, but the success hinged on this deceptively simple planted message.
Is gardening still useful with modern cryptography?
With modern encryption schemes, gardening by itself is not supposed to help an attacker. Contemporary cryptography assumes very strong adversaries. Many standard security definitions actually treat the attacker as having chosen-plaintext capabilities, meaning they can decide which plaintexts get encrypted and then see the resulting ciphertexts. A scheme is considered secure only if, even under those conditions, the attacker cannot learn anything useful about the secret key or other messages.
For example, widely deployed symmetric ciphers like AES, when used with proper modes of operation, are designed to remain secure even if an adversary can get encryptions of any messages they choose. Public-key schemes are similarly defined using notions like IND-CPA (indistinguishability under chosen-plaintext attack). In this formal framework, the cryptosystem must be safe even when an attacker is, in a sense, doing idealized gardening all the time.
Modern schemes are built so that knowing or even choosing the plaintext provides essentially no leverage for uncovering the key or decrypting other data.
However, real-world systems are more than just pure cryptographic algorithms. Protocols, implementations, and users can all introduce weaknesses. While the mathematics of AES or modern hash functions resist this kind of attack, predictable structure in messages, headers, or file formats can still be exploited in some contexts, especially if there are side-channel leaks or implementation bugs. Protocol designers therefore still think in gardening-like terms, asking: “What if an attacker can force the system to encrypt specific patterns?” Secure schemes must withstand that scenario by design.
So, as several cryptography educators note, gardening as a tactic has effectively been built into the threat models that modern schemes must survive. If gardening alone breaks a system, the system is considered poorly designed.

How does gardening relate to social engineering and human factors?
Gardening sits at the intersection of cryptanalysis and social engineering. Instead of attacking the pure math of a cipher, it attacks how people use that cipher and what they are compelled to communicate. Human habits and operational routines often create predictability, which is exactly what cryptanalysts need.
Historical accounts are full of examples. During World War II, some Enigma operators failed to choose truly random initial settings. One might consistently use his girlfriend’s initials for the message key, or follow an easy-to-remember pattern. British and Polish codebreakers exploited these predictable choices as informal “cribs”. In other cases, intelligence agencies used microphones or bugs to capture operators muttering settings aloud as they configured their machines, effectively bypassing the cipher by exploiting human behavior.
Modern security professionals emphasize that “humans are always the weakest part of a secure system.” While strong encryption can make ciphertext mathematically unbreakable, attackers still phish passwords, trick employees into revealing secrets, or manipulate processes to generate helpful patterns. Gardening is a formal, wartime version of that same mindset: instead of trying to smash the safe door, you trick someone into putting the combination on the table where you can see it.
In contemporary practice, this insight pushes designers to reduce predictable structure in protocols, randomize as much as feasible, and train users not to leak sensitive patterns. Although the word “gardening” is mostly used in historical discussions of codebreaking, the fundamental lesson remains relevant. Secure systems must assume adversaries will not only listen, but also try to provoke specific actions or messages that reveal structure.
