[00:00.000 --> 00:04.760] Our next speaker will be talking about Scrubber, an open source compilation to protect journalistic [00:04.760 --> 00:08.120] sources. Please give a warm welcome to Ethan Gregory Dodge. [00:12.250 --> 00:19.570] Thank you. Thank you. I am super excited to be here at the Privacy Village, Privacy Crypto [00:19.570 --> 00:24.290] Village. It's one of my very favorite villages and this is my first time speaking at it. [00:24.510 --> 00:28.330] Yesterday, or the other day, I told a coworker that I was speaking at the Crypto Village [00:28.330 --> 00:31.210] and he's all like, do you know anything about crypto? [00:32.170 --> 00:39.530] So, not talking about crypto today, however, I'm talking about privacy. And let's jump [00:39.530 --> 00:45.970] into it because I only got 20 minutes here. So, I'm Ethan Gregory Dodge. I was born and [00:45.970 --> 00:50.850] raised Mormon. That has nothing to do with this topic because it's from another slide [00:50.850 --> 00:56.050] deck. But I'm a digital forensics professional and I am a journalist. I'm the co-founder [00:56.050 --> 00:59.730] of the Truth and Transparency Foundation. And the Truth and Transparency Foundation [00:59.730 --> 01:03.470] was originally called Mormon Leaks, which is where my Mormonism comes into play. [01:05.050 --> 01:10.690] And we are essentially a nonprofit investigative newsroom dedicated to empowering the disenfranchised [01:10.690 --> 01:18.330] by promoting transparency within religious institutions. So, essentially, we get documents [01:18.330 --> 01:25.750] from anonymous sources all the time. And I'll tell her story in a second. Well, actually, [01:25.750 --> 01:30.930] let's just jump into it. Anyone know who this is? This is a picture of? Who is it? [01:31.510 --> 02:00.250] Reality Winner. And what happened to Reality Winner? Right. Right. Yeah. Yeah. So, essentially, [02:00.250 --> 02:05.590] what happened was she leaked a document to the Intercept and she printed it out. And [02:05.590 --> 02:13.330] the printer had left a fingerprint or a watermark that was nearly invisible. And [02:13.330 --> 02:17.730] she scanned it in and sent it to the Intercept. And the Intercept didn't know about it. And that [02:17.730 --> 02:23.950] fingerprint revealed the printer and the time that she had printed it out. And then the NSA [02:23.950 --> 02:29.430] was able to go camera and see who was there at that time. And she got caught. And she's now [02:29.430 --> 02:37.910] serving time in federal prison. So, this is an incredibly important topic. And so, as a journalist [02:37.910 --> 02:43.170] and as the technical director of the Truth and Transparency Foundation, anything technical and [02:43.170 --> 02:48.290] security or anything like that falls into my bracket. And I was spending a lot of time [02:48.290 --> 02:54.050] cleaning and compressing and optimizing PDF documents. And I would script it out little [02:54.050 --> 03:01.690] by little. And we launched in 2016. So, we're coming up on three years of doing this. And [03:02.690 --> 03:10.790] it was extremely tedious. Even the more when I scripted it out, it seemed like I found a [03:10.790 --> 03:17.290] brand new attack vector that I then had to account for and everything. And anyway, [03:17.930 --> 03:24.890] if you look back at our history, we actually released a ton of documents related to the [03:24.890 --> 03:31.550] Jehovah's Witnesses. And the source literally just gave me a hard drive of documents. And this is all [03:31.550 --> 03:40.550] public info because he has admitted to doing it to the press. And it was tens of thousands of PDFs, [03:40.550 --> 03:46.790] so I was like, fuck, I need to automate this. I'm not going to do this. And so, that's where [03:46.790 --> 03:56.590] Scrubber came into play. It leverages several tools, PDF tools, OCR and QPDF to clean OCR and [03:56.590 --> 04:09.050] linearize PDFs. The actual code that's cleaning the PDF of the excuse me. The actual code that's [04:09.570 --> 04:16.590] metadata from the PDF and watermarks and stuff like that is in PDF tools. OCR, my PDF, I'm just [04:16.590 --> 04:22.670] using it to put the text layer back. And I'll go through exactly why I need to put the text layer [04:22.670 --> 04:29.710] back. And then QPDF linearizes it. And linearizing PDFs is important if you're going to serve them [04:29.710 --> 04:34.670] over the web because what it allows you to do is it allows the browser to load one page at a time [04:34.670 --> 04:40.850] as you're scrolling through it rather than loading the entire PDF all at once before you [04:40.850 --> 04:47.490] can view it. And sometimes, like, we released PDFs that are hundreds of pages, right? And after [04:47.490 --> 04:54.190] this process, the PDF does get a little larger than your typical file. So, linearizing it is [04:54.190 --> 05:01.990] important for us. And essentially, Scrubber is just a bash script that's tying all of these [05:01.990 --> 05:06.830] tools together and automating the process that I've been doing manually for quite a while. [05:07.690 --> 05:15.810] So, it turns every single page into a PNG using PDF tools. PDF tools was developed by Micah Lee [05:15.810 --> 05:23.930] from the intercept. And since the reality winner case, they could have gotten past that by [05:23.930 --> 05:31.970] converting the PDF into a black and white image because the watermark was so light that it [05:31.970 --> 05:36.250] would have been registered as white when you turned the PDF into grayscale. So, PDF Redactools [05:36.250 --> 05:43.290] has that option to be able to get around that. You can also, so, it turns every single page into [05:43.290 --> 05:49.330] an image. And then if you want to, you can pass it a flag and it will stop in the middle after [05:49.330 --> 05:54.910] it's turned the pages into images. And then you can open them in GIMP and redact them wherever [05:54.910 --> 06:00.290] you need to. And then you can run it again and tell it to merge all the pages. Combines them [06:00.290 --> 06:06.930] into a PDF and stripping any embedded image data. If you were to go to Google Docs or [06:06.930 --> 06:16.430] Microsoft Word and put a JPEG or PNG into that document, you, and then you just download it as [06:16.530 --> 06:22.790] a PDF, you could then extract that PDF and potentially get the, extract that image from [06:22.790 --> 06:30.270] the PDF and get the metadata that can potentially be identifying and incriminating. So, what this [06:30.270 --> 06:36.910] does is it flattens the entire thing into one image and gets rid of that attack vector. And [06:36.910 --> 06:43.790] then it, because, because it, we turn it into images and then we put it, made it a PDF again, [06:43.790 --> 06:49.690] we have to add the OCR layer. And what the OCR layer is, it's what allows you to copy and paste [06:49.690 --> 06:56.170] from a PDF. It's the text layer, right? And so, OCR, my PDF leverages Tesseract. It's an amazing [06:56.170 --> 07:02.150] tool and it's funny because Scrubber is actually like a wrapper around several other wrappers [07:02.150 --> 07:06.050] around several other tools, right? So, we're getting pretty, we've got wrappers on wrappers [07:06.050 --> 07:12.890] on wrappers here. But, and then OCR, my PDF will also handle compression, which is super nice and [07:12.890 --> 07:18.270] make it, make sure that you're getting the smallest PDF size that you can while still [07:18.970 --> 07:23.990] getting a pretty decent quality. Sometimes you are going to have to sacrifice quality [07:23.990 --> 07:31.430] for, for size and whatnot, but, but that's just the name of the game. I mean, they're, [07:31.430 --> 07:36.450] they're always still readable, right? And that's the important thing. And then QPDF linearizes it [07:36.450 --> 07:40.330] for optimum web browsing. Like I said, it allows your browser to just load one page at a time [07:40.330 --> 07:45.290] rather than the entire PDF. And then this step is not necessary, but because I'm OCD, [07:45.290 --> 07:53.870] um, I still remove all, all the meta, the PDF metadata using Exif tool. Um, like I said, [07:53.870 --> 07:57.030] you don't really have to do that because the meta, the metadata that is in the Exif data [07:57.030 --> 08:06.370] that's in there is, um, generic to, and, and unique to this tool. Um, so this is, um, this [08:06.370 --> 08:10.850] is the best part about it, in my opinion, is I've dockerized it and you, and because of that, [08:10.850 --> 08:15.590] you could then run it on any operating system. So, um, essentially I'll go through, I'm going [08:15.590 --> 08:22.250] to do a demo here in a minute. Um, but you, you can clone the repo, run the scripts and it will [08:22.250 --> 08:26.630] pull the docker image down from docker hub. Or if you want to build the docker image locally and [08:26.630 --> 08:31.170] you don't want to, um, you don't want to risk your operational security by pulling down from [08:31.170 --> 08:35.570] docker hub, you can build it locally and then it'll, and then it'll run it to building locally [08:35.570 --> 08:40.410] does take forever because it's a huge ass image. It's like one and a half gigs. I'm [08:40.410 --> 08:45.510] going to work on decreasing that, but that's, that's where it is now. It takes about like [08:45.510 --> 08:50.050] anywhere from 10 to 30 minutes, depending on how fast your network connection is. [08:50.650 --> 08:57.330] Um, and the, and the, and your CPU processing power. So essentially you run a script, [08:57.330 --> 09:02.450] scrubber.sh, it then, uh, it either pulls down the image, the docker image from docker hub, [09:02.450 --> 09:08.010] or you build it locally, uh, starts a docker container. It runs PDF, redact tools, [09:08.010 --> 09:12.550] OCR my PDF, QPF and XF tool, and then it spits it out into an output file. [09:13.270 --> 09:19.590] Um, so the benefits of scrubber is you can run on any, uh, uh, on any operating system. Thanks [09:19.590 --> 09:27.130] to docker, even windows, um, caveat, I've never used docker on windows, so I, uh, that I don't [09:27.130 --> 09:31.030] know how hard it is to get installed or anything, but from what I understand, it's, it's pretty [09:31.030 --> 09:39.750] simple. Um, and, uh, it can handle large PDFs. Um, I have, so PDF redact tools actually leverages [09:39.750 --> 09:46.050] image magic to turn, uh, to turn every single page into, uh, into an image. And if you're [09:46.050 --> 09:50.530] doing large PDFs that can get, that can take up your memory quite a bit. I have it programmed [09:50.530 --> 09:54.910] to take up to four gigs of memory. You can, you could change that up if you need to, [09:54.910 --> 10:00.470] you would just have to rebuild the docker image locally. Um, I have 32 gigs of RAM on my laptop, [10:00.470 --> 10:05.630] and so it's not a huge deal, right? So, um, but, and, and it, and the reason why I have it going [10:05.630 --> 10:11.550] up is, is because, uh, thank you, is because I have, um, like I said, we've released PDFs that [10:11.550 --> 10:15.810] are hundreds of pages and turning images, hundreds, hundreds of PDF pages into images [10:15.810 --> 10:23.010] takes a shit ton of memory. Um, and then, uh, it provides just a one-stop tool for cleaning [10:23.010 --> 10:28.050] and optimization, right? That was the biggest problem is that like, all right, I can use this [10:28.050 --> 10:33.170] tool to clean it. And then I got to use this tool to optimize it. And I, and, and I got to use this [10:33.170 --> 10:37.950] tool to, for a long time, I didn't even know what OCR was like, to be completely honest with you [10:37.950 --> 10:42.750] guys. Um, and I was like, why isn't the text layer in there? And I just, I had a naive understanding [10:42.750 --> 10:50.910] of PDFs and, uh, and anyway, so I, I really like where this is at because it, yeah, it, it takes [10:50.910 --> 10:56.970] the PDF from its state that it got, that we got it from the source and then cleans it and then [10:56.970 --> 11:01.510] optimizes it for publishing on the web. Um, it also supports batches of PDFs. If you just give [11:01.510 --> 11:08.750] it a directory, um, of PDFs, it'll go, it'll go through, um, and, and chain and clean and optimize [11:08.750 --> 11:15.330] every single one. Um, that's the, that's the URL where it's at github.com, truth and transparency [11:15.330 --> 11:24.370] slash scrubber. Um, and let's do a demo really quick here. I recorded the demo, so don't worry. [11:27.110 --> 11:33.910] You're going to see my cat in this demo. All right. So essentially there is a PDF, like I was [11:33.910 --> 11:41.390] saying before, that PDF was just, uh, it's got an embedded JPEG of my cat, Lisa. Um, and, uh, [11:41.390 --> 11:46.290] right, right here, what I'm going to do, um, oh, I'm sorry. You can't really see what I'm doing [11:46.290 --> 11:50.970] there, but when I put it on YouTube, you'll be able to see it a whole lot easier. Um, I'm [11:50.970 --> 11:56.690] extracting that, that image of my cat, um, and, and then seeing that the exit data that was in it. [11:57.070 --> 12:02.850] Um, and then what I'm, um, and then I'm showing you that it extracted the single, the single [12:02.850 --> 12:08.570] image, and it also extracted the truth and transparency logo as well. Um, and now I'm [12:08.570 --> 12:16.010] going to actually run scrubber on that. Um, one thing to notice here, um, you can't really see [12:16.010 --> 12:23.290] it, but I'm actually passing it, um, the, the full file path. And that's a mistake on my part. [12:23.370 --> 12:28.110] Um, it doesn't support relative file paths right now. That is the first thing I'm going to fix [12:28.110 --> 12:32.710] in my rush to get this out. I totally forgot to take that into account. Um, don't worry. I [12:32.710 --> 12:37.350] already have an issue open on GitHub to take care of it. So anyway, so now it's going through, [12:37.350 --> 12:41.950] you can see this says running PDF for DAC tools, adding the text layer with OCR, my PDF, [12:41.950 --> 12:46.370] optimizing it for publication and removing the excess data. And then, uh, it says your final [12:46.370 --> 12:50.650] output is here. And then right here, I'm running, I'm going to try and extract the images again. [12:53.770 --> 13:00.450] If I could actually type it. So runs the command and it did extract an image, but you'll see [13:00.990 --> 13:06.610] that the image that it extracted is actually the entire PDF itself. And the it's, it's, it wasn't [13:06.610 --> 13:11.250] able to extract it. And then that's the actual clean version. And you'll see that that's me [13:11.250 --> 13:15.170] highlighting the OCR layer and you will see, um, let me back up a little bit. You can kind of see [13:15.170 --> 13:20.010] in, in my cat's ears here that the quality was kind of compromised a little bit, but, um, it did [13:20.010 --> 13:26.670] its job in, in the case of like, uh, being a journalistic source or anything. Um, you just [13:26.670 --> 13:34.730] really kind of need the text and whatnot and get in convey the, uh, the point. So, um, uh, that's [13:34.730 --> 13:39.890] all I really had. Um, I'm seven minutes early, but I will take as many questions as y'all got. [13:39.890 --> 13:47.990] If not, that's fine too. Yeah. All right. Thank you. Thank you. She's got a mic coming for you. [13:50.090 --> 14:01.040] Do you mind coming over here? Sorry, I was just asking if you could put the contact slide back [14:01.040 --> 14:11.620] up real quick. Yeah. My contact slide? Yeah, for sure. Uh, where did it go? Um, just to, as [14:12.090 --> 14:16.800] you'll see down here, I actually have the roadmap listed and these are things that I want to fix. [14:16.800 --> 14:23.160] And the number one issue is account for relative file paths. So let me pull the, um, the, uh, [14:23.160 --> 14:29.820] contact screen back up here. There it is. Yes. Hello. Uh, so can you talk a little bit about [14:29.820 --> 14:34.220] what you do for other file types? Like if you get a PPT, do you try to convert everything to PDF [14:34.220 --> 14:39.690] and then run this? Yeah. I typically as a, as a rule of thumb, like even if I get like a JPEG or, [14:39.690 --> 14:43.370] some sort of image file, or like you said, a PowerPoint presentation or something like that, [14:44.050 --> 14:49.650] I'll convert it to PDF as best I can without affecting the contents of the file. Sometimes [14:49.650 --> 14:54.330] that can get a little difficult and we have actually released like the raw PPT. But the [14:54.330 --> 15:00.230] reason why we avoid that is because there's, it's way harder to scrub, uh, an office document [15:00.230 --> 15:10.110] because Microsoft is terrible, but, um, so, and well, and to, to be fair, PDF is an awful file [15:10.110 --> 15:15.710] format as well. Right. There's so many, I mean, and the huge disclaimer, I have this in the read [15:15.710 --> 15:22.250] me. This is not a silver bullet by any means, right? I like, do not expect this to completely [15:22.250 --> 15:27.330] protect your sources. 100%. There's always a potent, there's always a possibility that they're [15:27.330 --> 15:33.010] going to, uh, to be identified, but this is definitely a really, really great place to start. [15:33.450 --> 15:41.270] Yeah. Do you have any plans on, uh, uh, getting it included in like the Debian upstream repos so [15:41.270 --> 15:46.210] that it could be used in something like tails? That would be awesome. I have not thought about [15:46.210 --> 15:52.130] that, but I know who to talk to, to, to see if that can happen. So that's a good idea. Thank you. [15:53.630 --> 16:00.450] So this great presentation and thanks for making this tool. So I could imagine that one response [16:00.450 --> 16:06.850] to proliferation of tools like this will just be slightly more insidious, I guess, watermarking [16:06.850 --> 16:12.310] kind of patterns and images and things like that. So is there, do you plan to support an option [16:12.310 --> 16:18.210] that's maybe like, I guess you'd call it paranoid mode that basically just extracts, you know, [16:18.210 --> 16:21.810] black and whites, everything to prevent encoding and images, removes images, [16:21.810 --> 16:25.810] and just tries to keep the text and like... That's a good idea. I get that would be really [16:25.810 --> 16:31.010] easy to do. Um, that's a great idea actually. Um, I can definitely do that. And if you want [16:31.010 --> 16:35.490] to help me, I would definitely, that's, I would definitely welcome help on this. That's the why [16:35.490 --> 16:39.930] I open sourced it. Feel free to submit poll requests. Um, but yeah, great idea. I'm definitely [16:39.930 --> 16:47.670] going to think about it. Thank you. Hey, so it's a really cool tool, but I wonder in [16:48.150 --> 16:53.290] scrubbing the file, don't you incidentally also remove authenticity of the file to verify that [16:53.290 --> 16:59.230] it's real? Uh, yeah. I mean, that's the part of it. That's the job of a journalist, right? Is to [16:59.230 --> 17:03.690] verify its authenticity. Um, I mean, and it, and it, I guess it comes down to, do you trust that [17:03.690 --> 17:09.070] journalist? Right. I mean, there are definitely people who claim to be journalists that I wouldn't [17:09.070 --> 17:15.950] trust right away, but like, um, I, and this is, this is something that we get, that we get asked [17:15.950 --> 17:21.090] about all the time is how we, uh, verify that the documents are authentic. Um, and that's not [17:21.090 --> 17:25.250] something that we talk about, but it is, that's, that's the job of the journalist and just whether [17:25.250 --> 17:34.210] or not you trust them. So great question though. Hey, can you put that GitHub link up back up [17:34.210 --> 17:39.310] again? Yep. There it is. Oh, thank you. Yeah. And, and back to a really quick to your, to your [17:39.310 --> 17:47.290] other question too, is it's also the journalist's responsibility, um, to, to disclose, to, to, let's [17:47.290 --> 17:53.230] see, what's the word I'm looking for? Um, inform their reader that they are positive that it's [17:53.230 --> 17:58.710] authentic or, and if, and if they can, without risking sources to, to disclose some, like there [17:58.710 --> 18:04.430] have been instances in which we, um, have disclosed how we verified it, um, because it wasn't a risk [18:04.430 --> 18:07.850] to our sources and stuff like that. And, and journalists should do that where they can, in my [18:07.850 --> 18:12.630] opinion. Uh, again, I will caveat it with this is I'm not a professional journalist. I do this on my [18:12.630 --> 18:18.830] side. I try really, really hard to, to do stuff up to a professional caliber, but, um, but yeah, [18:18.830 --> 18:26.410] thank you. All right. Any more questions? All right. Thank you. Thank you.