# Identifying the Leak Sources of Hard Copy Documents

Pulkit Garg, Garima Gupta, Ranjan Kumar, Somitra Sanadhya, Gaurav Gupta

► To cite this version:

Pulkit Garg, Garima Gupta, Ranjan Kumar, Somitra Sanadhya, Gaurav Gupta. Identifying the Leak Sources of Hard Copy Documents. 18th IFIP International Conference on Digital Forensics (DigitalForensics), Jan 2022, Virtual, United States. pp.155-167, 10.1007/978-3-031-10078-9_9. hal-05315731

HAL Id: hal-05315731

https://inria.hal.science/hal-05315731v1

Submitted on 15 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
<figure><img src="image_2.png" /></figure>

ifip

International Federation for Information Processing

This document is the original author manuscript of a paper submitted to an IFIP
conference proceedings or other IFIP publication by Springer Nature. As such, there
may be some differences in the official published version of the paper. Such
differences, if any, are usually due to reformatting during preparation for publication or
minor corrections made by the author(s) during final proofreading of the publication
manuscript.
Chapter 9

IDENTIFYING THE LEAK SOURCES OF
HARD COPY DOCUMENTS

Pulkit Garg, Garima Gupta, Ranjan Kumar, Somitra Sanadhya and Gaurav Gupta

**Abstract** Technological advancements have made it possible to use relatively inexpensive hardware and software to replicate and leak sensitive documents. This chapter proposes a novel canary trap method for determining the source of a leaked hard copy document. The method generates self-identifying documents that secretly encode unique information about the individuals who receive them by modifying the inter-word spacing in the original reference document. The encoded information is robust to changes introduced during printing, scanning and copying, rendering the method useful for hard copy as well as digital documents. Due to the lack of publicly-available datasets, a custom hard copy document leakage dataset comprising 100 scanned self-identifying documents encoded at four levels of robustness was created. The hard copy document leakage dataset was subsequently employed to evaluate the performance of the canary trap leak detection method.

**Keywords:** Hard copy documents, leak source identification, canary trap

# 1. Introduction

In today's data-driven world, it is important for organizations to safeguard their sensitive information from unauthorized access and dissemination. The unauthorized access and release of sensitive information can result in monetary losses, diminished reputation, legal exposure and potential shutdown of business activities. The impacts of information leaks from government organizations are much more severe; leaked military secrets can jeopardize national security.

Recent advancements in technology and the availability of sophisticated hardware and software have increased the likelihood and scope of information leaks. Also, due to the COVID-19 pandemic, most organiza-
tions have their employees working remotely, which means sensitive in-
formation is processed and stored outside secure internal environments.
An authorized individual with malicious intent can easily share sensi-
tive information with millions of people on the Internet within seconds.
Therefore, it is imperative to prevent information leaks and identify the
individuals responsible for information leaks.

A leaker can transmit sensitive information in several ways, by shar-
ing printed documents, sending email, using web applications and copy-
ing the information to removable storage. However, the most common
method for leaking sensitive information is via printed documents be-
cause they leave minimal evidentiary traces. Additionally, organizations
often store sensitive information in documents that can easily be repli-
cated using printers, scanners and copiers. The document replicas are
subsequently passed physically or shared online using messaging software
or social media platforms.

Organizations often employ canary traps to identify potential leak
sources. An organization sets up a canary trap by generating multi-
ple copies of a sensitive document (reference document), each with one
or more unique attributes that identify the copy. Each user (suspect)
receives one of the unique document copies. Later, if one of the users
leaks a document copy, the organization can extract the unique infor-
mation encoded in the copy to identify the source of the leak. Canary
traps are appealing, but the unique document copies created by current
techniques are visually distinguishable and lack robustness to errors in-
troduced when printing, scanning or copying documents.

This chapter describes a canary trap method that employs self-identi-
fying documents. The method creates unique document copies that are
visually indistinguishable from the reference document and other docu-
ment copies. The unique data in each document copy is then encoded
as a Quick Response (QR) code, which is embedded in the copy as a
binary string by modifying the inter-word spacing. QR codes with high
(30%) error correction capabilities render the method robust to errors
introduced when printing, scanning or copying the unique document
copies.

Due to the lack of publicly-available datasets, a custom hard copy
document leakage dataset was created to evaluate the performance of
the canary trap leak detection method. The custom dataset comprises
25 reference Microsoft Word (DOCX) documents and 100 scanned self-
identifying document copies. The 100 scanned self-identifying document
copies were created by encoding each reference document at four levels
of robustness.
## 2. Related Work

Several data leak prevention techniques have been proposed in the literature to identify the sources of leaks of printed documents. Kурaki and Nakagata [4] proposed multiple techniques to embed invisible data in printed documents. They used starlight patterns (holes in a tint-block background) and modified the shapes of printed characters such as font glyphs as well as figures and drawings. Kaneda et al. [2] embedded an electronically-readable watermark by superimposing single dot and double dot patterns in background blocks with 18 × 18 pixels. Kaneda et al. [1] subsequently enhanced their approach by introducing error correction capabilities using low-density parity checking (LDPC) codes. Safonov et al. [8] introduced clusters of black dots in documents that represented secret information while ensuring that significant distortions were not introduced in the documents; also, information was encoded at multiple locations in documents to render them robust to modifications and noise. Beusekom et al. [11] proposed a technique that utilizes machine identification codes to identify the printers used to generate printed copies of documents. Although these three techniques are data independent, starlight patterns, watermarking and machine identification codes are very small and they may vanish after multiple rounds of scanning or copying.

Researchers have also developed techniques that introduce changes in the foreground of documents (written text). Low et al. [6] proposed a watermark encoding algorithm that shifts lines and words in documents according to a watermark bit. It segments lines into three groups of words and shifts the central group to the left and right. However, this technique requires the original document to be present at the time of decoding.

Zou and Shi [13] developed a technique that adjusts the inter-word spacing between adjacent words. It divides each line into two parts so that the sum of inter-word spacing (say, $s_1$ and $s_2$) of the two parts are nearly equal. Later, the inter-word space is modified such that, if the encoded bit is one, then ($s_1 - s_2$) is positive; otherwise, it is negative.

Varna et al. [12] proposed a data hiding technique that modifies the shapes of characters by adding or removing two pixels from the left strokes of characters and uses error-correcting codes to correct errors and erasures. Tan et al. [9] developed a watermarking technique that identifies rotatable strokes in Chinese characters and modulates their directions according to the payload watermarks; the technique sorts the centroids of the strokes and embeds payloads in sequential order to ensure the proper ordering of bits during decoding. Loc et al. [5] developed
<figure><img src="image_3.png" /><figcaption>*Figure 1. Leak source identification method overview.*</figcaption></figure>

a watermarking scheme that identifies stable regions in text documents (i.e., robust to noise during printing and scanning), further dividing them into strokes and fills; watermarks are encoded by computing the hiding factor for each fill region and assigning a zero or one accordingly. Nayak et al. [7] proposed a technique that embeds secret information in documents by changing the fonts of certain letters. Kozachok et al. [3] developed a technique that encodes watermarks by modifying line spacing within perceptual invisibility.

All the techniques described above are not robust against adversarial errors and have low data hiding capacities. In contrast, the proposed method employing self-identifying documents provides an optimal balance between data storage capacity and error robustness.

## 3. Proposed Method

Techniques for identifying the leak sources of digital documents are ineffective for hard copy documents because multiple iterations of printing, scanning or copying hard copy documents introduce noise and degrade document quality. To overcome this limitation and enhance robustness, the proposed method generates self-identifying copies of a reference document, each with unique encoded information tied to an individual user (suspect).

Figure 1 presents an overview of the proposed leak source identification method. The method involves two steps, self-identifying document creation and leak source identification. During the self-identifying document creation step, three self-identifying documents corresponding to a single reference document are created for users A, B and C. During the leak source identification step, the encoded information is extracted from each of the self-identifying documents that is uniquely associated
<figure><img src="image_4.png" /><figcaption>Figure 2. Self-identifying document creation.</figcaption></figure>

with a user. The encoded information in the leaked document is then decoded to identify the leaker of the document.

## 3.1 Self-Identifying Document Creation

Figure 2 illustrates the creation of self-identifying documents, each document associated with a different user. The unique identifier created for a user is encoded as a QR code, which is subsequently converted to a binary string. The error correction capability of a QR code makes it possible to decode the extracted binary string even if the code is corrupted to a certain degree. The margins of the resulting document are also modified to compensate for the increased number of characters per line due to the addition of whitespace characters. This step is crucial to eliminate visual changes and increase the similarity between the reference and self-identifying documents. This work demonstrates the application of the method to Microsoft Word (DOCX) documents, but the method is readily applied to other document formats.

**Binary String Generation.** The assumption is that a sensitive document will be shared with a certain number of users. The initial task is to acquire unique distinguishing information for every user. This information may include the user name, organizational email address, identity number, IP address of the computing system being used, etc. However, this information cannot be encoded directly in the document given to the user. This is because a leaker might print, scan and/or copy the document with the encoding many times. As a result, the leaked document would contain noise that induces classification errors when decoding the leaked document. Therefore, the proposed method requires error correction capabilities.
<figure><img src="image_5.png" /><figcaption>*Figure 3. Omission of position patterns to obtain a reduced binary string.*</figcaption></figure>

QR codes possess desirable characteristics such as high error correction and strong robustness to distortion, but still have small sizes (binary representations). QR codes encoded with the H error correction can tolerate errors up to 30%. Therefore, a Version 1 QR code is employed in an intermediate step. Specifically, the unique user identifier is encoded as a QR code, which is converted to a binary string (in row-major order) where one represents a black pixel and zero represents a white pixel. Since Version 1 QR codes have 21 × 21 pixels, the length of the generated string is 441 bits.

As mentioned above, the proposed method embeds the binary string corresponding to a QR code in a document by altering the inter-word spacing. Since the inter-word whitespace positions in a document are limited, it is necessary to reduce the size of the binary string that is generated.

Figure 3 shows how position patterns may be omitted to obtain a reduced binary string. The highlighted portions are known as position patterns and their relative locations and sizes remain the same for all the QR codes. Therefore, the pixels corresponding to the position patterns can be omitted, enabling the QR code size to be reduced by 192 bits, yielding a final string with 249 bits.

**Binary String Encoding.** Upon inserting whitespace in a document, the cursor shifts by a constant amount to the right which is not altered by printing, scanning or copying. The whitespace is uneven only when the text in the document is justified (i.e., text is aligned with the left and right margins). For ease of analysis, it is assumed that the reference document is right-, left- or center-aligned. Since the changes in whitespace characters are hardly noticeable and robust to small errors, the whitespace is modified to encode the secret information.

Figure 4 shows self-identifying document text created from reference document text by encoding it with the string `01010101`. The binary
<figure><img src="image_6.png" /><figcaption>Figure 4. Self-identifying document text encoded with 01010101.</figcaption></figure>

string `01010101` is encoded in the line of text such that, if a one is encountered, then the corresponding whitespace is doubled.

The proposed method uses two pointers to implement this task, one pointer for the original data and the other for the binary string to be inserted:

* The original data pointer is iterated over a line until a whitespace is encountered.

* The pointer to the binary string is read. If the value pointed to by the binary string pointer is a one, then an extra whitespace is added at the original data pointer location. If the value pointed to by the binary string pointer is a zero, no change is made.

* The original data pointer and binary string pointer are incremented to point to the next character and the preceding steps are repeated until the end of the binary string is reached.

* Thus, the line is modified by encoding the given binary string in the line.

**Optimization.** Due to optical character recognition (OCR) errors, the possibility exists that the decoding process may not detect all the whitespaces and skip some of them. This would cause the bits in the extracted binary string to shift towards the left, inducing a large error. For example, the original string `01010101` could be retrieved as `01001010`. In
<figure><img src="image_7.png" /><figcaption>Figure 5. Leak source identification.</figcaption></figure>

this case, the bit in the fourth position from the left in the original string is skipped. Therefore, every bit in the retrieved string starting with the fourth position onwards is misclassified. To limit such errors, the proposed method modifies only ten whitespace characters per line. Therefore, only lines with more than 11 words are encoded with the secret information.

The character count per line in a Microsoft Word document is not constant and depends on various uncontrollable factors. Adding whitespace characters in a line can cause the last few words to move to the next line. To maintain visual similarity with the reference document, the left and right margins of the self-identifying document are reduced accordingly.

## 3.2 Leak Source Identification

Leak source identification involves the extraction of the encoded binary string from the scanned image of a leaked document and the retrieval of the unique user identifying information by regenerating and decoding the QR code.

Figure 5 shows the steps involved in source identification. First, optical character recognition is performed and the coordinates of every word are determined. Next, the distances between consecutive words are computed, arranged in a sequential manner and classified as ones or zeros. Following this, position pattern bits are added to create the QR code. Finally, the QR code is decoded to identify the source of the leak.

**Text Extraction.** The Tesseract open-source optical character recognition library [10] is used to extract the words in the scanned documents
along with their bounding boxes. The coordinates of each word are computed and arranged sequentially from left to right and top to bottom as they appear in the document.

**Binary String Retrieval.** The horizontal distances between the bounding boxes of consecutive words are computed. If the distance exceeds the threshold value, the output bit is one; otherwise, the output bit is zero. The output bits are arranged as a one-dimensional array in row-major order to produce a binary string.

**Unique Identifier Decoding.** During the encoding process, the binary string representing the QR code is compressed by removing position pattern bits and the remaining information is encoded in the document. Since the relative position and size of the position pattern is the same for every QR code, the retrieved binary string is modified to obtain a valid version 1 QR code. Specifically, the binary string is reshaped as a 21 × 21 array corresponding to the QR code. The QR code is then decoded using ZXing, an open-source QR code library [14]. The source of the leak is identified using the QR code.

# 4. Document Dataset

Due to the lack of publicly-available datasets, a custom hard copy document leakage dataset comprising 100 scanned self-identifying documents encoded at four levels of robustness was created. Twenty-five reference documents with random text from the Internet were prepared using Microsoft Word 2016. The document text is in the Times New Roman font with a font size of 12. Figure 6(a) shows a sample reference document.

QR codes have four error correction (EC) levels, L, M, Q and H. Increasing the error correction capability decreases the storage capacity. To analyze the impact of the error correction levels on the proposed method, four self-identifying documents corresponding to the four error correction levels were created for each of the 25 reference documents. To model a real-world scenario, the self-identifying documents were printed and scanned at 300 dpi using an HP LaserJet P1007 printer and HP ScanJet Pro 2000 F1 scanner, respectively.

Table 1 summarizes the dataset content. Figures 6(b), 6(c), 6(d) and 6(e) show scanned samples of the self-identifying documents corresponding to error correction levels EC-L, EC-M, EC-Q and EC-H, respectively.
## What is Statistics?

Statistics is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, industrial, or social problem, it is conventional to begin with a statistical population or a statistical model to be studied. Populations can be diverse groups of people or objects such as "all people living in a country" or "every atom composing a crystal". Statistics deals with every aspect of data, including the planning of data collection in terms of the design of surveys and experiments.

(a) Sample self-identifying document.

## What is Statistics?

Statistics is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, industrial, or social problem, it is conventional to begin with a statistical population or a statistical model to be studied. Populations can be diverse groups of people or objects such as "all people living in a country" or "every atom composing a crystal". Statistics deals with every aspect of data, including the planning of data collection in terms of the design of surveys and experiments.

(b) Sample self-identifying document (EC-L).

## What is Statistics?

Statistics is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, industrial, or social problem, it is conventional to begin with a statistical population or a statistical model to be studied. Populations can be diverse groups of people or objects such as "all people living in a country" or "every atom composing a crystal". Statistics deals with every aspect of data, including the planning of data collection in terms of the design of surveys and experiments.

(c) Sample self-identifying document (EC-M).

## What is Statistics?

Statistics is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, industrial, or social problem, it is conventional to begin with a statistical population or a statistical model to be studied. Populations can be diverse groups of people or objects such as "all people living in a country" or "every atom composing a crystal". Statistics deals with every aspect of data, including the planning of data collection in terms of the design of surveys and experiments.

(d) Sample self-identifying document (EC-Q).

## What is Statistics?

Statistics is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, industrial, or social problem, it is conventional to begin with a statistical population or a statistical model to be studied. Populations can be diverse groups of people or objects such as "all people living in a country" or "every atom composing a crystal". Statistics deals with every aspect of data, including the planning of data collection in terms of the design of surveys and experiments.

(e) Sample self-identifying document (EC-H).

<caption>Figure 6. Document dataset samples.</caption>
<table><caption>Table 1. Dataset content.</caption><thead><tr><th></th><th>EC-L</th><th>EC-M</th><th>EC-Q</th><th>EC-H</th><th>Total</th></tr></thead><tbody><tr><td>Self-Identifying Documents</td><td>25</td><td>25</td><td>25</td><td>25</td><td>100</td></tr></tbody></table>

## 5. Experimental Results

The decoding success rate and bit error rate metrics were employed to evaluate the performance of the proposed leak source identification method. The decoding success rate, which corresponds to the percentage of self-identifying documents that were decoded successfully, conveys the robustness of the method. The bit error rate, which measures the error (mismatch) in an extracted binary string, is computed as the percentage of white pixels in the XOR of the original and extracted QR code.

<table><caption>Table 2. Experimental results.</caption><thead><tr><th>Evaluation Metric</th><th>EC-L</th><th>EC-M</th><th>EC-Q</th><th>EC-H</th></tr></thead><tbody><tr><td>Decoding Success Rate (DSR)</td><td>80%</td><td>96%</td><td>96%</td><td>100%</td></tr><tr><td>Bit Error Rate (BER)</td><td>0.57%</td><td>1.39%</td><td>0.57%</td><td>0.44%</td></tr></tbody></table>

Table 2 shows the decoding success and bit error rates obtained for the scanned self-identifying documents, 25 documents at each of the four error correction levels. QR codes with EC-H yielded the best decoding success rate and bit error rate results. This is not surprising because EC-H has the highest error correction capability and lowest storage capacity. On the other hand, EC-L has the lowest error correction capability and highest storage capacity. Clearly, a tradeoff exists between accuracy and data capacity. Also, it is important to note that, although QR codes with EC-L have similar bit error rates compared with QR codes with EC-Q, they have lower decoding success rates. This is because QR codes with EC-Q are more robust than QR codes with EC-L.

The bit error rate of 1.39% is very high for QR codes with EC-M. Upon manual examination, it was determined that a single document contributed the most to the high bit error rate. Specifically, during the decoding process, optical character recognition interpreted two words separated by a hyphen as a single word. The misinterpretation reduced the word count in the line to ten (less than the minimum required count of 11 words), which caused the line to be skipped. The cascading effect led to an erroneous extracted string and high bit error rate.
Misclassifications caused by hyphens also occurred for some self-identifying document samples, but they did not lead to large errors because of the limited number of hidden characters per line. Except for the rare scenario where the hyphen misclassification reduced the word count in a line to under 11, the proposed method successfully decoded the extracted binary strings.

## 6. Conclusions

The canary trap method proposed for determining the source of a leaked hard copy document generates self-identifying documents that secretly encode unique information about the individuals who receive the documents by modifying the inter-word spacing in the original reference document. The method uses QR codes to provide robustness against errors introduced when printing, scanning or copying the self-identifying documents. Experimental results demonstrate that a decoding success rate of 100% was obtained for QR codes with the high (H) error correction level even after printing, scanning and copying the self-identifying documents, rendering the proposed method useful in real-world applications.

The canary trap method is unsuitable for justified documents with text aligned relative to the left and right margins. The space occupied by whitespace characters in a justified document is not the same every time; instead, it depends on the number of characters present in the line. Another problem is the anomalies introduced by optical character recognition when processing special characters such as hyphens. Future research will refine the canary trap method to handle justified documents and will optimize the optical character recognition process to address the anomalies caused by special characters in documents.

## References

[1] K. Kaneda, H. Kitazawa, K. Iwamura and I. Echizen, A study of equipment dependence of a single-dot-pattern method for information hiding by applying an error-correcting code, *Proceedings of the Tenth International Conference on Intelligent Information Hiding and Multimedia Signal Processing*, pp. 497–501, 2014.

[2] K. Kaneda, F. Nagai, K. Iwamura and S. Hangai, A study of information hiding performance using a simple dot pattern with different tile sizes, *Proceedings of the Fourth International Conference on Intelligent Information Hiding and Multimedia Signal Processing*, pp. 323–326, 2008.
[3] A. Kozachok, S. Kopylov, A. Shelupanov and O. Evsutin, Text marking approach for data leakage prevention, *Journal of Computer Virology and Hacking Techniques*, vol. 15(3), pp. 219-232, 2019.

[4] V. Kuraki and V. Nakagata, Watermarking technologies for security-enhanced printed documents, *Fujitsu Science and Technical Journal*, vol. 43(2), pp. 197-203, 2007.

[5] C. Loc, J. Burie and J. Ogier, Stable regions and object-fill-based approach for document image watermarking, *Proceedings of the Thirteenth IAPR International Workshop on Document Analysis Systems*, pp. 181-186, 2018.

[6] S. Low, N. Maxemchuk, J. Brassil and L. O'Gorman, Document marking and identification using both line and word shifting, *Proceedings of the Fourteenth Annual Joint Conference of the IEEE Computer and Communications Societies*, vol. 2, pp. 853-860, 1995.

[7] J. Nayak, S. Singh, S. Chhabra, G. Gupta and M. Gupta, Detecting data leakage from hard copy documents, in *Advances in Digital Forensics XIV*, G. Peterson and S. Shenoi (Eds.), Springer, Cham, Switzerland, pp. 111-124, 2018.

[8] I. Safonov, I. Kurilin, M. Rychagov and E. Tolstaya, Embedding digital hidden data into hardcopy, in *Document Image Processing for Scanning and Printing*, I. Safonov, I. Kurilin, M. Rychagov and E. Tolstaya (Eds.), Springer, Cham, Switzerland, pp. 219-250, 2019.

[9] L. Tan, X. Sun and G. Sun, Print-scan resilient text image watermarking based on stroke direction modulation for Chinese document authentication, *Radioengineering*, vol. 21(1), pp. 170-181, 2012.

[10] R. Theis, tess-two version 9.1.0, GitHub (github.com/rmtheis/tess-two), 2015.

[11] J. van Beusekom, F. Shafait and T. Breuel, Automatic authentication of color laser print-outs using machine identification codes, *Pattern Analysis and Applications*, vol. 16(4), pp. 663-678, 2013.

[12] A. Varna, S. Rane and A. Vetro, Data hiding in hard-copy text documents robust to print, scan and photocopy operations, *Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing*, pp. 1397-1400, 2009.

[13] D. Zou and Y. Shi, Formatted text document data hiding robust to printing, copying and scanning, *Proceedings of the IEEE International Symposium on Circuits and Systems*, vol. 5, pp. 4971-4974, 2005.

[14] ZXing Project Contributors, ZXing 3.4.1, GitHub (github.com/zxing/zxing), 2020.