pk.org: CS 419/Lecture Notes

Hiding Information

Steganography, watermarking, and hidden communication

Paul Krzyzanowski – 2026-11-26

Introduction

Set in the 17th century, a legend tells of Sir John Trevanion, an English politician during the English Civil War, who faced execution with little hope of escape. Just as the end drew near, a letter arrived from his loyal servant. To the guards, it looked like an ordinary, rambling note filled with sympathy and encouragement. But to Sir John, it carried a hidden message, one only he could understand.

Worthie Sir John, –Hope, that is ye beste comfort of ye afflicted, cannot much, I fear me, help you now. That I would saye to you, is this only: if ever I may be able to requite that I do owe you, stand not upon asking me. ‘Tis not much that I can do: but what I can do, bee ye verie sure I wille. I knowe that, if dethe comes, if ordinary men fear it, it frights not you, accounting it for a high honour, to have such a rewarde of your loyalty. Pray yet that you may be spared this soe bitter, cup. I fear not that you will grudge any sufferings; only if bie submission you can turn them away, ‘tis the part of a wise man. Tell me, an if you can, to do for you anythinge that you wolde have done. The general goes back on Wednesday. Restinge your servant to command. R.T.

By applying a secret rule both men had agreed on earlier, he took the third letter after each comma, period, colon, or semicolon, counting letters only, and assembled a hidden instruction: “Panel at east end of chapel slides.” When he was granted an hour in the chapel for prayer, he followed the instructions, found the hidden panel, and escaped through a concealed tunnel, evading his execution1.

Whether legend or not, it is a good illustration of a concealment cipher (or null cipher): a message hidden in plain sight using a rule known only to the sender and receiver. The letter is an example of steganography, the practice of hiding the existence of a message rather than scrambling its content. The word comes from the Greek steganos (covered) and graphia (writing), and literally means covered writing.

Cryptography hides what a message says. An eavesdropper who intercepts ciphertext cannot read it, but can still see that a message was sent, when it was sent, and often who sent it and who received it. Sometimes that reveals too much. Hiding goes beyond encryption in two ways:

  1. Steganography hides the existence of a message by embedding it in ordinary content.

  2. Hiding communication conceals the communication itself: that it is happening at all, who receives it, or who is talking to whom.

Watermarking is the companion topic to steganography. It uses the same techniques to embed information into content, but the goal is marking rather than hiding. A watermark identifies the content’s origin, its owner, or the fact that it was machine-generated, and it is designed to be detected.

We begin with steganography, from its ancient origins through the ways data is hidden in images, audio, video, and text today. We then turn to watermarking, including the current problem of marking AI-generated content, where text turns out to be far harder to mark than images or audio. We end with hiding communication: covert channels, anonymity, and Tor.

Steganography vs. Watermarking

Steganography and watermarking are closely related, and people often use the terms interchangeably. Both techniques hide information inside content, but they serve different purposes and face different threats.

Steganography is about enabling communication, usually between two parties, while keeping the communication itself hidden. Someone who does not know what to look for should not be able to tell that a message is there.

Three characteristics define steganography:

  1. The cover object looks untouched. Any changes must be invisible and statistically hard to detect.

  2. The hidden data is a payload: an arbitrary message being sent secretly.

  3. The adversary’s goal is detection. If an analyst can prove that hidden data is present, the scheme has failed, even if the message cannot be read.

Watermarking, by contrast, is used to mark content with information about the content itself: its origin, its owner, or rules for how it can be used, such as digital rights management. The mark may be invisible, but it does not have to be. Watermarking is usually one-to-many: one mark is applied to content that will be distributed widely.

Three characteristics define watermarking:

  1. The watermark does not need to be hidden. Many are invisible, but secrecy is not required.

  2. The embedded information is tied to the object rather than being an arbitrary message. It may identify the owner, the license, or the device that produced the content.

  3. The adversary depends on the purpose. A mark that claims ownership must survive cropping, compression, resampling, and other transformations, while a mark that detects tampering must fail when the content changes.

A variant of watermarking is fingerprinting, which embeds a different identifier into each copy of distributed content. If a copy leaks, the embedded identifier shows which recipient it came from.

Classic Techniques in Steganography

People have been hiding messages inside ordinary objects for as long as people have sent messages. The techniques below span more than two thousand years:

Wax-covered tablets were a common writing surface in ancient Greece: a wooden board coated with wax that could be written on and then smoothed over. The Greek historian Herodotus, writing in the fifth century BC, tells how Demaratus, an exiled Spartan king living in Persia, warned Sparta that Xerxes planned to invade. In about 480 BC, he scraped the wax off a tablet, wrote his warning on the wood underneath, and covered it with fresh wax. The tablet passed inspection as a blank one, and the message was recovered by scraping the wax off again.

Messages written on a shaved head come from the same historian. Around 499 BC, Histiaeus, a Greek ruler held at the Persian court, wanted to send instructions urging a revolt. He shaved the head of a trusted servant, tattooed the message on his scalp, and waited for the hair to grow back. The servant traveled without carrying anything suspicious, and the recipient shaved his head to read the message. Delivery was slow, but the message stayed hidden the whole time.

Concealment ciphers (null ciphers) hide a message within seemingly ordinary text using a predefined rule, such as reading the first letter of every word or every nth letter in the text. The Trevanion letter is one example. Another comes from World War I, in a message sent by a German spy:

Apparently neutral’s protest is thoroughly discounted and ignored. Isman hard hit. Blockade issue affects pretext for embargo on byproducts, ejecting suets and vegetable oils.

Reading the second letter of each word reveals “Pershing sails from NY June I.” By World War II, null ciphers were used less by spies and more by ordinary people trying to slip information past censors. They still appear in prison and gang communication, hidden in innocuous letters or classified ads.

Invisible ink conceals a message that becomes visible only under certain conditions, such as exposure to heat, ultraviolet light, or a developing chemical. During the American Revolution, both George Washington’s spies and British agents used invisible inks to transmit military information. Lemon juice was a common choice: invisible when dry, visible when the paper is heated.

Microdots shrink a message or image photographically to the size of a printed period, which can then be pasted into a letter or document. German intelligence used them heavily during World War II to move blueprints, maps, and instructions on paper that appeared harmless. Reading one required magnification equipment.

Knitting can encode data in the arrangement of stitches. In World War I, Belgian intelligence recruited women living near railway stations to monitor German train movements. As they knitted, they would purl a stitch when an artillery train passed and drop a stitch when a troop train passed, producing an innocent-looking record of enemy logistics. The practice continued in World War II: Phyllis Latour Doyle, a British agent who parachuted into occupied Normandy in 1944, encoded her messages in her knitting. Both the United States and the UK banned the mailing of printed knitting instructions during the war, fearing coded content. Charles Dickens had imagined the idea decades earlier: in A Tale of Two Cities, published in 1859, Madame Defarge knits the names of the condemned into her work.

Pin-prick codes place tiny perforations over selected letters in a book or newspaper. The marked letters spell out the message, and the paper looks ordinary unless it is held up to a light.

Signals hidden in behavior can serve when text is impossible. In 1966, U.S. Navy pilot Jeremiah Denton, a prisoner of war in North Vietnam, was placed in front of a camera for a propaganda interview. While answering questions, he blinked the word TORTURE in Morse code, confirming to U.S. intelligence how American prisoners were being treated. His captors noticed only the odd blinking.

Chaffing and Winnowing

Chaffing and winnowing is a modern technique introduced in 1998 by Ron Rivest, one of the inventors of RSA. It takes its name from the process of separating wheat (the valuable grain) from chaff (the worthless husks).

The technique does not encrypt the message. Instead, it sends the real data (the wheat) together with fake data (the chaff) and lets the receiver separate them. Rivest’s construction transmits each bit of the message as a pair of packets: one asserts the bit is 0 and the other asserts it is 1. The packet with the real value includes a valid message authentication code (MAC) computed with a key known only to the trusted parties, while its partner includes a random value where the MAC belongs. The receiver checks each MAC and keeps the packets that verify. An eavesdropper can read every packet, but without the key, a valid MAC and a random value look identical, so both packets of each pair appear equally genuine. Security comes from indistinguishability rather than from concealment or scrambling.

Why Steganography and Watermarking Are Used Today

Steganography is about helping the sender, while watermarking is about helping the owner.

Steganography is useful to anyone who needs to communicate without making that communication obvious:

Watermarking appeals to whoever creates, owns, or distributes content:

The same methods serve all of these users. A technique that helps a dissident hide a message can also help malware hide a payload, and research that improves one can improve the other.

Image Steganography

Images are one of the most common cover media for digital steganography. A message can be hidden in an image in three common ways:

Metadata fields

Image formats usually contain more than just pixel data. They also include metadata such as camera model, exposure settings, GPS coordinates, and user comments. JPEG, TIFF, and many raw formats support EXIF (Exchangeable Image File Format) metadata, and PNG supports text chunks.

This is not really steganography in the strict sense, since these fields are well known and are hidden only in the sense that they are not part of the visible image. Even so, they can be an effective way to move data covertly, since content-filtering firewalls often treat images as harmless.

Least significant bit encoding (LSB steganography)

The simplest form of image steganography modifies the least significant bits of pixel values. An image is a grid of pixels, and each pixel holds RGB (red, green, and blue) color values of 8 bits each. Changing the highest-order bit of a value changes the color dramatically. Changing the lowest-order bit changes the value by 1 out of 256, which is usually imperceptible.

Embedding works as follows:

  1. Take the bits of the message.

  2. Walk through the pixels in some order, possibly determined by a secret key.

  3. In each selected color channel, replace the least significant bit with the next bit of the message.

The receiver, knowing the key and the embedding order, reads the same pixels and reconstructs the bitstream. To everyone else, the image looks unchanged. The raw capacity is substantial: a 40-megapixel photo contains 120 million color values, so using every least significant bit provides 15 megabytes of storage. But raw capacity is not the same as usable capacity. Every replaced bit disturbs the image’s statistics, and an embedder who uses anywhere near the maximum is easy to detect, so careful schemes embed only a small fraction of it.

Frequency-domain embedding

Some compressed image formats, like JPEG, do not store raw pixel intensities. Instead, they transform each $8 \times 8$ block of pixels using the Discrete Cosine Transform (DCT) and store a matrix of frequency coefficients. Low-frequency coefficients describe smooth changes, while high-frequency coefficients capture rapid changes such as edges and texture.

Human vision is more sensitive to low-frequency changes than high-frequency ones. A viewer is more likely to notice distortion in a clear blue sky (low frequency) than in a leafy tree (high frequency). JPEG compression takes advantage of this by quantizing high-frequency coefficients more aggressively, and steganography can exploit the same property.

JPEG steganography works inside the compressed representation rather than on pixels. After the DCT, the encoder rounds each block’s coefficients to small integers (quantization), and those integers are what the file stores. A typical method works as follows:

  1. Decode the file’s entropy coding to recover the quantized DCT coefficients.

  2. Select nonzero mid- or high-frequency coefficients according to a key.

  3. Modify the selected coefficients slightly, such as adjusting their least significant bits, to encode the hidden data.

  4. Re-encode the coefficients to produce a valid JPEG file.

The recipient decodes the same coefficients and reads the chosen positions. Because the data is embedded after quantization, saving the file does not disturb it. Later processing is another matter: recompressing the image at a different quality setting or resizing it recomputes the coefficients and can destroy the payload.

The choice of cover medium matters. Media with more natural noise, such as photographs and music, hide modifications better than clean synthetic content. A photo of a forest conceals changes that a flat corporate logo would expose.

Steganalysis

Steganalysis is the detection of hidden content. The defender does not need to recover the message; proving that a message exists is enough to defeat steganography. Several techniques are used:

The same idea applies to audio, video, and text: many embedding techniques leave statistical traces, and the analyst’s task is to find a statistic that the embedder did not preserve. There is also a clear trade-off for the person hiding data: the more data that is embedded, the greater the statistical disturbance, and the easier it is to detect.

Research continues on schemes that defeat statistical detection entirely. In 2023, researchers at the University of Oxford and Carnegie Mellon University used a technique called minimum entropy coupling to construct steganography that is provably undetectable under the paper’s model: when the cover content is generated from a known distribution, such as a model’s output, the distribution with hidden data matches the distribution without it, and statistical tests cannot distinguish them. The result is conceptually similar to perfect secrecy in encryption, and it works with machine-generated cover content such as model-generated text and images.

Audio Steganography

Audio can also contain hidden data. Digital audio is a sequence of samples, usually 16-bit or 24-bit integers, and the least significant bits can be changed with little or no audible effect.

More advanced methods use the same psychoacoustic principles found in audio compression formats like MP3 and AAC: they hide data in places where people are unlikely to hear the distortion. Several embedding techniques are used:

Modern audio watermarking also uses neural networks. Meta’s AudioSeal, published in 2024, trains one network to embed a watermark and another to detect it. The goal is to keep the watermark hard to hear while making it reliable to detect after common operations such as cropping, filtering, noise addition, and recompression. AudioSeal reports better robustness than earlier systems, but it is still vulnerable to adversarial attacks: the more an attacker knows about the algorithm, the easier the watermark is to remove.

Video Steganography

Video combines image frames, audio, and motion information, which gives it a high capacity for hidden data. Common video steganography techniques include:

The main challenge is robustness. Video is often transcoded, downscaled, and re-encoded for streaming, so the hidden data has to survive those changes. A visible mark, such as a network logo in the corner of the screen, is a watermark rather than steganography because it is meant to be seen.

Text Steganography

Text steganography has been around since the earliest forms of secret communication, and it still shows up in digital settings today. A piece of text can carry more than just its literal words: formatting, punctuation, and word choice can all be used to hide information. Broadly, text steganography falls into four styles: layout-based, syntactic, semantic, and markup-based.

Layout-based text steganography

Layout-based schemes take advantage of the fact that readers usually do not notice small formatting changes. A few common approaches are:

A well-known example of layout-based fingerprinting is often linked to former British Prime Minister Margaret Thatcher. In the 1980s, she was reportedly frustrated by cabinet documents leaking to the press. Each minister received a copy that looked identical to the others, but the word processors had been set up so that the spacing between words encoded the recipient’s identity. When a document leaked, investigators examined the spacing and traced the leak to the matching copy.

These techniques work in printed documents and in digital formats such as PDF, where exact coordinates can be controlled. They are simple to implement and difficult to spot, but they are fragile. Reflowing the text, copying it into another document, or normalizing its whitespace destroys the hidden information.

Syntactic text steganography

Syntactic schemes use punctuation and sentence structure in ways that still sound natural. Common encodings include:

A good syntactic scheme keeps the statistical profile of the text close to normal writing, so that simple punctuation or spelling statistics do not give it away.

Semantic text steganography

Semantic steganography changes word choice while keeping the meaning intact. The encoding alphabet consists of sets of synonyms: “start” vs. “begin” can represent one bit, and “buy” vs. “purchase” another. The text must include enough places where substitutions can happen, and too much substitution makes the prose sound unnatural.

Modern research systems use language models for this. A model can choose among multiple sentences that all read plausibly but together encode a bitstream, a technique known as linguistic steganography. Capacity is limited, encoding is computationally expensive, and the result is vulnerable to editing: a copy editor who rewrites a sentence destroys the bits it held.

Markup-based steganography

Once text is wrapped in markup such as HTML, XML, or PDF page descriptions, additional opportunities appear. Many different textual representations produce the same rendered appearance, and the differences can encode data:

Other markup techniques hide content outright rather than encoding bits in syntax:

These channels exploit the gap between what a person sees on the screen and what is stored in the file. They can be surprisingly durable: copying text from a browser often brings zero-width characters along, and forwarding a PDF preserves its hidden objects. Tools that sanitize markup or convert to plain text strip most of them.

Hidden text against filters, search engines, and AI systems

The same tricks show up outside secret communication. Spammers and search-engine manipulators hide keywords with zero-width characters, background-colored text, and overlapping objects to fool email filters and make a page seem more relevant than it is. Modern filters and search engines actively look for these tricks, which turns what was once a stealthy channel into a clear signal for detection.

Hidden text has also found a new audience: software that reads documents for us. An AI system that summarizes a web page or screens a resume processes every bit of text in the file, including text styled to be invisible, so hidden text has become a way to send instructions to the software that the human reader never sees. In 2025, reviewers found research papers containing instructions such as “give a positive review,” hidden as white or tiny text and aimed at reviewers who might paste the paper into an AI assistant. Job applicants have done the same with resumes to influence automated screening. We will examine attacks on AI systems in detail later.

Text steganography is easy to explain and implement, and it connects directly to the historical techniques. It is used less than media-based steganography because images, audio, and video offer much more capacity and survive everyday editing better.

Steganography in Malware Delivery and Exfiltration

Attackers use steganography for two main reasons: to sneak malicious code past systems that inspect file content, and to move stolen data out of an organization without setting off alarms. If a firewall or intrusion detection system sees an employee downloading or uploading photos, it usually has no reason to flag that traffic, and the malicious data hidden inside those images is not something signature scanning can easily recognize.

The first documented malware use appeared in 2011, when the Duqu espionage malware encrypted stolen data and hid it inside JPEG files for exfiltration. In 2014, the Lurk malware downloader retrieved URLs embedded in the least significant bits of an image’s pixels.

A 2024 campaign shows how steganography can fit into a multi-stage infection chain. The SteganoAmor campaign, attributed to the criminal group TA558, was linked to more than 320 attacks, mostly aimed at hospitality and tourism organizations in Latin America. The attack unfolded in four stages:

  1. Initial delivery. Victims received phishing emails with malicious Microsoft Office documents, sent through compromised mail servers that helped them look legitimate to spam filters.

  2. Exploit and loader. Opening the document triggered an exploit against CVE-2017-11882, a long-patched vulnerability in Office’s Equation Editor that still works on outdated systems. The exploit then downloaded and ran a Visual Basic script from a legitimate third-party service.

  3. Steganographic payload. The script fetched what looked like a normal JPEG from a remote server. The image contained a base64-encoded payload hidden steganographically.

  4. Extraction and final stage. A PowerShell script pulled out the hidden data and used it to download and install the final malware, which established persistence and connected to the attacker’s infrastructure.

Security products that inspected the downloads saw an image, not an executable.

Other documented cases include:

Steganography now shows up in commodity malware too, not just nation-state operations.

Classic Techniques in Watermarking

Watermarks date back to 1282, when papermakers in Fabriano, Italy pressed a wire design into the mold while the paper was still wet. Once dried, the paper had a uniform thickness but slightly different densities, so the design showed up when held to the light and identified the maker or trade guild. Watermarks later found their way into banknotes as a way to make counterfeits easier to spot, beginning with notes issued by Stockholms Banco, the Swedish bank, in 1661.

The EURion constellation, also called Omron rings, is a pattern of five small circles repeated on many modern banknotes. Scanners, copiers, and image-editing programs can recognize it and refuse to reproduce the currency. It appears on notes from dozens of countries, including those in the euro area, the UK, the US, Japan, India, and China.

UV watermarking is used on passports, currency, and event hand stamps. These marks are invisible in normal light, but they show up under ultraviolet light.

Fragile vs. Robust Watermarks

Fragile watermarks are meant to break when the content changes, which makes them useful for authentication and tamper detection. They show up in currency, passports, and tickets: the person holding the item has every reason to keep the mark intact, because if it is damaged, the item is no longer valid. Digital content works the same way. A camera or editing tool can embed a fragile mark across an image so that even a small change to the pixels destroys it. If a photo submitted as evidence has been altered, verification fails, and the broken regions of the mark can reveal where the alteration happened.

Robust watermarks are meant to survive transformation, which makes them useful for tracking ownership and distribution. They are used in photos, videos, audio, and documents: the holder of a copy may want the mark removed, so it has to survive cropping, compression, format conversion, and re-recording.

Robustness is always defined against a specific set of transformations. A mark is not robust in the abstract. It is robust against cropping and recompression, or against scaling and rotation, or against being played through a speaker and recorded with a microphone. The designer specifies the set, and an adversary defeats the mark by finding a transformation that is outside that set but still leaves the content usable.

Digital Watermarking

Digital watermarks use the same basic embedding techniques as steganography, depending on the goal. A fragile mark can be placed in least significant bits, where even a small change will destroy it. A robust mark is spread lightly across many pixels, samples, or frequency coefficients, following the same spread-spectrum idea used in audio. Because the mark is weak and distributed throughout the content, it is hard to remove without visibly damaging the image or sound, and it can survive cropping and recompression that would wipe out an LSB mark.

Robust watermarks and fingerprints are widely used in commercial settings. Digimarc, whose watermarks are embedded in much of the world’s stock photography, helps image owners search the web for marked copies. Movie studios fingerprint each advance copy of a film. In 2004, the Academy of Motion Picture Arts and Sciences traced leaked awards screeners back to Carmine Caridi, an actor and voting member, after marks in the pirated copies identified his discs. Streaming services fingerprint video for each session, so a copy made with a camcorder can still identify the account that played it.

Printer Watermarking and Hidden Identifiers

Color laser printers and some copiers add hidden marks of their own. Many devices print a grid of faint yellow dots on every page, nearly invisible in normal light and visible only under magnification or blue light. Those dots can encode the printer’s serial number and the date and time the page was printed. This machine identification code was originally created at the request of governments to help trace currency counterfeiting, and most people never know it is there. In a sense, it is steganography in the physical world: information hidden in the pattern of dots rather than in visible text.

The code became widely known in 2017, when Reality Winner, a U.S. intelligence contractor, printed a classified NSA report, took it out of a secure facility, and mailed it to a news outlet. The outlet published a scanned copy, and within hours outside observers had found the yellow dot grid and decoded the printer’s serial number and the print date. The FBI’s affidavit points to a different trail: an internal print audit showing that six people had printed the report, along with Winner’s email contact with the outlet from her work computer.

Marking AI-Generated Content

Generative AI has created a new need for watermarking: labels that show when content was machine-made so people, platforms, and courts can distinguish it from recordings of reality. This matters because fabrication is now cheap and convincing. In January 2024, for example, an AI-generated robocall imitating President Biden’s voice told New Hampshire voters to stay home during the primary, and it is no longer easy to tell such fakes apart by ear or eye.

There are three approaches, and they work best together:

  1. Provenance metadata: cryptographically signed records attached to a file that show how it was created and edited.

  2. Watermarks embedded at generation: imperceptible marks the model places directly in the content.

  3. Post-hoc detection: classifiers that review unmarked content and estimate whether it was machine-generated.

Provenance metadata and C2PA

The Content Authenticity Initiative (CAI), launched by Adobe with the New York Times and Twitter in 2019, promotes provenance standards and tools. The Coalition for Content Provenance and Authenticity (C2PA), formed in 2021 by combining the CAI’s work with a Microsoft and BBC project, publishes the open standard behind Content Credentials.

The basic idea is to attach signed metadata to media files showing which device or application created the content, when it was captured, and what edits were made with which tools. Hashes tie the metadata to the pixels or samples, and digital signatures protect the metadata itself. Each editing tool adds a new signed statement, creating a verifiable chain from capture to publication. A viewing tool can then show, for example, that a JPEG was captured by a particular camera model at a particular time and later cropped in a specific application. If the hashes no longer match the content, the viewer warns that the file was changed outside the recorded chain.

Adoption has moved from demonstrations into real products. By 2026, the C2PA counted more than 6,000 member organizations with live uses of Content Credentials. Leica, the German camera maker, shipped the first camera that signs photos at capture in 2023, and Sony, Nikon, and Canon followed in their professional models. In 2025, Google’s Pixel 10 became the first phone to attach Content Credentials to photos as they are taken. OpenAI attaches credentials to DALL-E and Sora output, TikTok became the first major social platform to label AI-generated uploads using them in 2024, and YouTube uses them to label unaltered camera footage.

Content Credentials follow the fragile-watermark model: the person creating the content wants the credential to stay intact and verifiable.

Content Credentials have three limitations:

Watermarks embedded at generation

The second approach builds the mark into the content as the model generates it. Google DeepMind’s SynthID family is the most widely deployed example. For images, audio, and video, SynthID embeds an imperceptible watermark directly in the pixel values or waveform, designed to survive compression, cropping, resizing, and re-encoding. Google reported in 2025 that over 10 billion pieces of content had been watermarked across its Imagen, Veo, Lyria, and Gemini products. In 2026, Google opened its SynthID Detector portal to the public, which checks uploaded media for watermarks from Google’s models and from partner companies, including OpenAI and NVIDIA. Meta’s AudioSeal does the same for speech generated by its models.

Watermarks and metadata fail in different ways, which is why providers use both. A screenshot strips Content Credentials, while a robust image watermark can survive it. A watermark cannot be inspected or extended by third-party tools the way signed metadata can. Digimarc and others combine watermarks with C2PA so that a stripped file can be linked back to its credentials.

Researchers have also flipped the problem around: instead of marking synthetic content, they mark genuine content at capture. A Cornell team demonstrated noise-coded illumination in 2025: lights in a scene modulate their intensity in a coded sequence, so every real video of that scene contains the code, while a fabricated video does not. Other systems, such as the research prototypes FaceSigns (2022) and FaceGuard (2021), let people watermark their genuine photos so that deepfakes built from them fail verification. These schemes label trusted originals rather than detecting fakes.

Apple built the same idea into the camera. Reference Image, an opt-in mode introduced with the iPhone 18 Pro in 2026, has the image sensor itself sign the raw pixel data at capture, with signed timestamps that record when the photo was taken. Apple’s servers develop the signed data into a reference image that cannot be altered. A recipient who has the reference image can compare it with a shared photo, and the sender decides whether to provide it. Trust moves from the editing chain to the sensor hardware.

Labeling laws

Regulation is now pushing adoption. China’s labeling rules took effect on September 1, 2025: AI-generated text, images, audio, and video distributed on Chinese platforms must have an explicit label visible to users and an implicit label embedded in the file, and platforms must check for the labels. In the European Union, the AI Act’s transparency obligations applied from August 2, 2026: providers of systems that generate synthetic content must mark their output in a machine-readable, detectable form, with fines reaching into the millions of euros. California’s AI Transparency Act took effect the same day, deliberately aligned with the EU date, and requires large generative AI providers to embed disclosures in their output and to offer the public a free detection tool.

These laws require providers to mark their content. They cannot require the marks to survive, and for one medium in particular, the marks are fundamentally weak.

Watermarking AI-Generated Text

Text is the hardest medium to watermark. An image has millions of pixel values, each able to absorb tiny changes below the threshold of perception, and audio has millions of samples with the same built-in slack. A page of text has only a few hundred words, and every one is visible to the reader. There is no imperceptible layer to hide in. The only room to work is in the choice of wording, so the watermark has to be embedded in the words themselves.

Statistical watermarks

A language model generates text one token at a time, and at each step it chooses from a probability distribution over possible next words. A statistical watermark nudges those choices in a way that a detector can later recognize.

The scheme that later systems build on was published in 2023 by researchers at the University of Maryland. At each step, a function seeded with a secret key and the preceding words splits the vocabulary into a “green” list and a “red” list, and the sampler slightly favors green words. Any single sentence looks normal. Across a few hundred words, green words start to show up more often than expected. A detector that knows the key replays the splits, counts green words, and calculates how unlikely that count would be in human text, where green words appear at the chance rate. The result is a confidence score rather than a yes-or-no answer, and it behaves like any statistical test. Human text can still skew green by chance, so detection has a false-positive rate, and anyone acting on a score has to choose a threshold that balances false accusations against missed detections.

Google’s SynthID-Text refines this design with a tournament: candidate continuations are compared in rounds using keyed scoring functions, and the winner is emitted. Google has watermarked Gemini’s text output since 2024, published the method in Nature, and released an open-source implementation, reporting that the watermark does not measurably reduce text quality. It is the first text watermark deployed at scale.

Anthropic followed in August 2026, announcing that new Claude models watermark their text output with a scheme based on SynthID-Text, while generated image files are signed with C2PA Content Credentials. The company tied the change directly to the EU transparency rules that took effect that month. Its announcement also sets out the limits: the watermark shows that Claude was involved rather than identifying any user, heavily edited or short text may not be detectable, and code receives a weaker mark since code usually has to be exact. Detection is available through a restricted API, initially to regulators, fact-checkers, researchers, and organizations with their own compliance obligations.

OpenAI built a comparable system years earlier and has not yet deployed it, though it has said that it plans to. Reporting in 2024 put its internal accuracy at 99.9 percent on long passages of unmodified ChatGPT output. The company cited two concerns: the watermark is easy to remove, and it would fall hardest on legitimate users, such as non-native speakers who use AI to polish their writing.

Why text watermarks are weak

Text watermarks have five basic weaknesses:

  1. The watermark depends on choice. It only works when the model has room to choose among different words. When output is constrained, there is little freedom to influence: a factual answer, a quotation, a translation of a specific sentence, or boilerplate code leaves few options. Low-entropy output is weakly marked or unmarked.

  2. Short texts are hard to detect. Detectors usually need hundreds of tokens to be confident. A watermarked paragraph may be detectable, but a watermarked sentence often is not.

  3. Editing can remove the signal. Every word a person changes weakens the evidence. Paraphrasing the text, including by asking a second AI model to rewrite it, effectively resamples the words. Researchers have shown that repeated paraphrasing can push detection rates close to chance while preserving meaning.

  4. Only cooperating models mark their output. A detected watermark shows that the provider’s model generated the text. Unmarked text could come from a person or from a model.

  5. Publishing the key weakens the mark. A public detector lets an attacker try edits until detection fails. Knowing the scheme also makes spoofing possible, where an attacker creates text that another provider’s detector will flag, framing that provider’s model as the source. For that reason, deployed systems usually restrict their detectors, which limits who can benefit from them, although schemes with publicly verifiable detection are an active research area.

Detection without a watermark

Post-hoc detectors take the opposite approach: they try to classify unmarked text by looking for statistical patterns, such as how predictable each word is from the words before it. Commercial tools built on this idea are marketed to teachers and editors, but they are unreliable. OpenAI released its own classifier in early 2023 and withdrew it within months because of low accuracy. A 2023 Stanford study found that popular detectors flagged more than half of a sample of essays written by non-native English speakers as AI-generated, while essays by native speakers were classified correctly. Simpler vocabulary and more regular phrasing can look like model output. A detector score by itself is not reliable evidence that a person used AI.

Text provenance therefore depends on several partial signals used together: signed metadata where it survives, watermarks where the generator cooperates and the text is long and unedited, detector scores as weak evidence, and human judgment about context for the rest. Marking is a cooperative act that labels the output of providers who choose to participate, and someone determined to pass machine text off as human can use a model that does not label anything.

Hiding Communication

Steganography and watermarking hide or mark the content of communication. But communication itself can also be the secret: that it is happening at all, who receives it, or who is talking to whom. Much of this course has focused on the opposite goal. Certificates, signatures, passwords, and authenticated TLS sessions all exist to tie communication to identities. Hiding communication is the deliberate removal of that tie.

Hidden communication has a bad reputation because it is associated with spam, scams, trafficking in illegal goods, and money laundering. But there are also legitimate reasons to do it:

Anonymity

The Common Criteria, the international standard for security evaluation (ISO 15408, 1999), defines two properties an anonymity system can provide:

  1. Unobservability means a user can use a resource or service without others being able to observe that it is being used.

  2. Unlinkability means a user can make multiple uses of resources or services without others being able to link those uses together.

The main attack on both properties is the correlation attack: an observer matches events on one side of a system with events on the other by timing and volume until the connection reappears. Every technique we cover, from numbers stations to Tor, tries to make correlation expensive.

Numbers Stations

Hiding communication is older than the Internet. Numbers stations are shortwave radio stations that broadcast a voice reading lists of numbers on a fixed schedule, without identifying who is speaking. They have been used since the Cold War to pass instructions to operatives in the field. The numbers are believed to be messages encrypted with one-time pads, so an intercepted broadcast cannot be read without the pad. Direction finding has traced the signals to Russia, Cuba, Israel, North Korea, and, reportedly, the United States, but governments almost never acknowledge the stations.

The design has lasted because it favors the receiver. Anyone with a cheap shortwave radio can pick up the broadcast anywhere in the world, and listening does not leave a trace, since there is no account, connection, or log to record it. The transmitter can be located, but it sits in friendly territory, where finding it accomplishes little. Shortwave signals are also hard to jam, and they do not depend on Internet infrastructure.

The method is still in use. In 2002, Ana Montes, a senior analyst at the U.S. Defense Intelligence Agency, was convicted of spying for Cuba. For years, she had received her tasking as encrypted numbers read over a Cuban shortwave station.

Dead Drops

A dead drop cuts the link between the two parties. In classic espionage, one person leaves material in a prearranged hiding place, like a hollow bolt or a gap behind a loose brick, and the other picks it up later. The two cannot risk being seen together, so the drop lets them avoid meeting at all. To anyone watching, each person just seems to be going about ordinary business.

The digital equivalent is a message left in a public place online. A forum post, a comment under a social media photo, an auction listing, or a draft saved in a shared email account can hold a message, often hidden steganographically, that the other party reads without the two ever contacting each other. In 2017, researchers discovered malware that took its instructions from comments posted under a celebrity’s Instagram photo: the comments decoded to the address of the malware’s command-and-control server. The Russian sleeper agents arrested in 2010 used the same structure, with images on public websites as the drop.

Covert Channels

A covert channel is a way of sending information through a mechanism that was never meant for communication. It lets two cooperating programs, or a program and an outside observer, pass information in a way that breaks the policy meant to keep it private.

In 1973, Butler Lampson, a computer scientist at Xerox PARC, described the confinement problem: how to run a borrowed program so it cannot leak the data it processes. Simply blocking explicit output is not enough. Lampson pointed out that a program can still signal through side effects the system does not treat as output, and he called these paths covert channels. They fall into two categories:

  1. A storage channel signals through some shared attribute of the system. A confined program that cannot write files can still create and delete a lock file, fill and free disk space, or change a file’s name. A colluding program checks that attribute and reads the message one bit at a time.

  2. A timing channel signals through when observable events happen. The sender changes its CPU usage, and the receiver measures how slowly its own code runs. Busy means 1 and idle means 0.

Covert channels are related to the side channels that show up in hardware attacks such as cache timing, but they are different in intent. A side channel is an unintentional leak that an attacker notices from the outside, such as how long a cryptographic operation takes. A covert channel involves a cooperating sender that is deliberately modulating something to get information out. The bandwidth is usually low, but it does not need to be high: a cryptographic key or a credit card number is only a few hundred bits. The U.S. Department of Defense’s 1983 evaluation criteria for secure systems (the Orange Book) required covert channel analysis at its higher assurance levels, and estimating a channel’s bandwidth was part of that analysis.

Networks offer covert channels of their own, and network steganography is their modern form. The visible traffic might be ordinary web browsing, a video call, or DNS lookups, with data hidden where observers rarely look:

These channels appeal to malware authors because the covert traffic blends in with traffic that security products expect to see. Detecting them takes statistical analysis of traffic behavior rather than inspection of content.

The limits of ordinary privacy tools

Many services keep information about their users, including accounts, settings, purchase history, cloud storage, and browsing history. Sites also track interests through cookies for data mining and targeted advertising.

Browsers offer private browsing modes, such as Chrome’s Incognito and the private windows in Safari, Firefox, and Edge. A private browsing window typically does the following:

Private browsing only affects what the browser stores locally. The operating system may still log outbound connections. Web servers can still see the user’s IP address and correlate it with past visits. Proxies, firewalls, and routers along the way record where traffic goes. The ISP knows the customer’s identity and the domains contacted, and DNS servers see every name looked up.

Encryption does not fix this. TLS hides the plaintext, but an eavesdropper can still see where the traffic is coming from and where it is going. A commercial VPN service moves the problem rather than eliminating it. The user’s ISP still sees the subscriber’s address and the connection to the VPN, and the destination sees the VPN’s address instead of the user’s. The VPN provider can associate the user with every outbound connection, and TLS still protects the request and response contents from the provider. The user must trust the provider’s honesty and logging policy. A VPN is a single relay, and whoever runs the relay links both ends.

Mobile devices add tracking surfaces of their own. Phones scan for WiFi access points and Bluetooth devices, broadcasting identifiers as they go. Modern phones randomize the MAC address they broadcast, which limits tracking by hotspot operators.

The surface web, deep web, and dark web

The surface web is the part of the internet that search engines can find and index. The deep web includes content crawlers cannot access, such as dynamically generated pages, library search results, and government and corporate databases. The dark web is a hidden part of the deep web. Its servers do not use regular DNS names, and you need special software, such as the Tor Browser, to reach them. Dark web services use the .onion pseudo-top-level domain:

group domain
CIA http://ciadotgov4sjwlzihbbgxnqg3xiyrg7so2r2o3lt5wz5ypk4sxyjstad.onion/
Facebook https://www.facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion/
ProPublica http://p53lf57qovyuvwsc6xnrppyply3vtqm7l6pcobkmyqsiofyeznfu5uqd.onion/

These names are long and random-looking because they are not registered names. A dark web service generates a public/private key pair, and the current version 3 address encodes the public key itself, along with a checksum and a version byte, all base32-encoded. The checksum is created by hashing the key, and encoding the key, checksum, and version byte produces the fixed 56-character name. The name is self-certifying, because anyone who knows the name also knows the service’s public key.

The CIA’s domain starts with ciadotgov, and Facebook’s starts with facebook. These vanity addresses are made by brute force: generate key pairs until the encoded address begins with the desired characters. Each extra fixed character multiplies the expected number of attempts by 32, so short prefixes are practical and long ones are not. The search works like Bitcoin’s proof of work: keep trying until you get the result you want.

The dark web hosts both legitimate and illegal services. ProPublica and BBC News run .onion mirrors for readers in censored countries, DuckDuckGo offers search, SecureDrop lets newsrooms receive anonymous leaks, and the CIA runs a mirror for tips. Illegal services include markets for drugs, stolen identities, and hacking tools.

Tor: The Onion Router

Tor gives people anonymous access to the Internet by routing traffic through a network of relays run by nonprofits, universities, and individuals around the world. The network has about 9,000 active relays and an estimated 2 to 3 million daily users who connect directly.

History

Onion routing was developed in 1995 at the U.S. Naval Research Laboratory to protect U.S. intelligence communications. It was designed as a way to use the Internet without revealing who was talking to whom, even to someone watching the network. The Navy patented onion routing in 1998 and released the code under a free license. Tor was deployed in 2002, and the Tor Project was founded in 2006 as a nonprofit with support from the Electronic Frontier Foundation (EFF), the digital civil liberties organization. A tool built for intelligence work became public for a practical reason: an anonymity network used only by spies would not be anonymous, because anyone connecting to it would identify themselves as a spy. The network needed ordinary users to blend into.

From mix networks to onion routing

In 1981, David Chaum, the cryptographer whose work also led to digital cash, proposed mix networks for anonymous email:

Mix networks provide strong anonymity, but a node has to wait for a batch to fill up, which adds latency. That works for email, but it is too slow for interactive web browsing.

Onion routing keeps the layered encryption but drops the batching in favor of low-latency forwarding:

Tor is the most widely deployed onion-routing system.

Why multiple relays?

A single relay is vulnerable to correlation. If Eve can watch both sides of a relay, she sees Alice send something in and something come out headed for store.com, and matching them by time and size is straightforward even when the connections are encrypted. Tor uses three relays by default, spread across different operators, networks, and countries, so one observer is unlikely to see both ends of a circuit. Even so, if someone does see both ends, they can still correlate timing and sizes. Spreading the relays lowers that risk, but it does not make correlation impossible.

What each observer sees

Tor is designed so that each party who handles or observes the traffic learns too little to connect the user to the destination. On a circuit to a public website, each observer sees a different piece:

HTTPS between the client and the website protects the request and response contents from the exit relay. But network anonymity does not extend into the application itself: a website can still identify a user who signs in to an account, no matter which path the traffic took.

A VPN provider, by contrast, sees the client’s address and every outbound connection in one place. Tor splits that knowledge across three relays run by unrelated operators. The remaining risk is end-to-end correlation, where an observer who watches both the client’s traffic and the exit’s traffic matches the two by timing and volume.

The Tor consensus

Every relay generates a public/private key pair. A set of trusted directory authorities votes on the state of the network and signs the consensus document, which is updated hourly and lists every valid relay with its IP address, ports, and bandwidth, and points to a descriptor carrying each relay’s public keys. A client bootstraps by downloading the consensus and descriptors from the authorities or their mirrors.

Circuits

A client chooses a list of relays for its path, called a circuit. Only the final relay, the exit node, knows it is the last hop. Tor relays resolve names using their own DNS resolvers rather than the client’s.

Alice builds the circuit one hop at a time. She connects to Relay 1 over TLS and performs an authenticated Diffie-Hellman key exchange with it, producing a shared symmetric key S1. The authentication is one-way, using Relay 1’s public key from its descriptor: Alice checks that she reached the relay she selected, while the relay learns only her IP address. To extend the circuit, Alice sends Relay 1 a message encrypted with S1 that tells it to extend the circuit to Relay 2. Her key exchange with Relay 2 is forwarded through the circuit. Relay 1 can see the public parts of that handshake, but it cannot derive the resulting key, and the exchange gives Alice and Relay 2 a key S2. The process repeats for Relay 3, giving Alice keys S1, S2, and S3, while each relay knows only its neighbors.

The entry position gets special treatment. A client does not choose a new entry relay for every circuit. Instead, it selects a small set of guard relays and keeps using them for months. The entry relay is the one that sees the client’s IP address, and an attacker who runs relays would want to end up there. Picking a random entry for every circuit would eventually route some circuits through such an attacker, while sticking with a few honest guards avoids attacker-controlled entries over time. Even so, if an observer can watch an honest guard’s incoming traffic, they can correlate it with traffic at the destination side.

Sending messages

To send data, Alice encrypts it with S3, then S2, then S1, and sends it to Relay 1. Each relay peels off one layer. The innermost layer tells the exit node to open a TCP connection to the destination and deliver the data. Responses travel back along the same path, with each relay adding its layer back.

Tor is not a VPN. It does not encapsulate IP or TCP packets. It relays data streams, and the exit node makes the actual TCP connection to the destination. Forwarding raw packets would make the client’s operating system identifiable from protocol details, which is why Tor rebuilds the connection at the exit. End-to-end TLS between the client and the destination still works on top of Tor.

Onion services

Services behind .onion addresses are onion services, and connections to them never leave the Tor network. The anonymity works both ways: the client does not learn where the service is hosted, and the service does not learn who the client is. Setting up a connection takes three steps:

  1. The service builds circuits to a few relays that act as its introduction points and publishes them, along with its public key, in a signed descriptor that clients can look up from the .onion name.

  2. A client picks an unrelated relay as a rendezvous point, builds a circuit to it, and then, through a separate circuit to an introduction point, tells the service which rendezvous point to use.

  3. The service builds its own circuit to the rendezvous point, where the two circuits are joined. The rendezvous relay only forwards data that is encrypted end to end between the client and the service.

Both sides reach the rendezvous through their own multi-relay circuits, so each side’s location stays hidden from the other and from the rendezvous relay. An exit node is never involved, since the traffic does not leave Tor. The .onion name encodes the service’s public key, so the client can verify the signed descriptor and know it has reached the right service.

Limitations of anonymity

An attacker does not need to break Tor’s cryptography:

Threats to Tor

Tor faces ongoing attacks on the network itself:

I2P and garlic routing

I2P, the Invisible Internet Project, is an alternative anonymity network that uses garlic routing: messages for different destinations are bundled together at a relay, each with its own delivery instructions, which makes traffic analysis harder than with one message per onion. Where Tor circuits are bidirectional, I2P builds separate unidirectional tunnels for outbound and inbound traffic, and it locates services through a distributed hash table rather than a directory consensus. I2P focuses on anonymous hosting of services inside the network, with anonymous email, chat, file sharing, and publishing built on top of it. Tor has far more users, which itself improves anonymity, and it focuses on anonymous access to the public Internet.

Mesh networks for Internet-free communication

Anonymity tools assume the Internet is available and merely watched. Sometimes it is shut off or too dangerous to use. In 2019, Hong Kong pro-democracy protesters adopted Bridgefy, an app that discovers nearby phones over Bluetooth and relays messages from phone to phone until they reach their target, with the Internet never involved. Downloads grew almost 4,000 percent over two months. The technology was originally built for communicating at crowded concerts and sporting events, and it is also used in disaster areas where infrastructure is down.

During the 2022 Russian invasion of Ukraine, the most downloaded apps in Ukraine included Signal, the encrypted messenger, Bridgefy, offline map applications, and walkie-talkie apps that work without accounts or personal information. Ukrainians were preparing to communicate through the loss of their Internet access or its capture.


  1. See this article in Cryptiana for a discussion. The validity of this story is in doubt. While it has been presented by many authors, there do not seem to be any primary sources, and some details are questionable. ↩