1 00:00:00,000 --> 00:00:05,460 Our next speaker will be talking about Scrubber, an open source compilation to protect journalistic sources. 2 00:00:05,460 --> 00:00:08,120 Please give a warm welcome to Ethan Gregory Dodge. 3 00:00:12,250 --> 00:00:13,310 Thank you. 4 00:00:13,310 --> 00:00:14,370 Thank you. 5 00:00:14,490 --> 00:00:20,390 I am super excited to be here at the Privacy Village, Privacy Crypto Village. 6 00:00:20,930 --> 00:00:24,290 It's one of my very favorite villages and this is my first time speaking at it. 7 00:00:24,510 --> 00:00:31,210 Yesterday, or the other day, I told a coworker that I was speaking at the Crypto Village and he's all like, do you know anything about crypto? 8 00:00:32,170 --> 00:00:37,450 So, not talking about crypto today, however, I'm talking about privacy. 9 00:00:38,710 --> 00:00:41,330 And let's jump into it because I only got 20 minutes here. 10 00:00:41,330 --> 00:00:44,890 So, I'm Ethan Gregory Dodge. 11 00:00:44,890 --> 00:00:46,410 I was born and raised Mormon. 12 00:00:46,410 --> 00:00:51,230 That has nothing to do with this topic because it's from another slide deck. 13 00:00:51,230 --> 00:00:55,450 But I'm a digital forensics professional and I am a journalist. 14 00:00:55,450 --> 00:00:57,930 I'm the co-founder of the Truth and Transparency Foundation. 15 00:00:57,930 --> 00:01:03,470 And the Truth and Transparency Foundation was originally called Mormon Leaks, which is where my Mormonism comes into play. 16 00:01:05,050 --> 00:01:13,910 And we are essentially a nonprofit investigative newsroom dedicated to empowering the disenfranchised by promoting transparency within religious institutions. 17 00:01:14,950 --> 00:01:20,390 So, essentially, we get documents from anonymous sources all the time. 18 00:01:20,470 --> 00:01:24,950 And I'll tell her story in a second. 19 00:01:24,950 --> 00:01:26,690 Well, actually, let's just jump into it. 20 00:01:26,690 --> 00:01:28,710 Anyone know who this is? 21 00:01:28,970 --> 00:01:30,110 This is a picture of? 22 00:01:30,110 --> 00:01:30,930 Who is it? 23 00:01:31,510 --> 00:01:32,370 Reality Winner. 24 00:01:32,370 --> 00:01:34,030 And what happened to Reality Winner? 25 00:01:53,190 --> 00:01:54,190 Right. 26 00:01:55,210 --> 00:01:56,090 Right. 27 00:01:57,750 --> 00:01:58,690 Yeah. 28 00:01:58,910 --> 00:01:59,530 Yeah. 29 00:01:59,530 --> 00:02:04,970 So, essentially, what happened was she leaked a document to the Intercept and she printed it out. 30 00:02:05,350 --> 00:02:12,890 And the printer had left a fingerprint or a watermark that was nearly invisible. 31 00:02:13,030 --> 00:02:14,890 And she scanned it in and sent it to the Intercept. 32 00:02:14,890 --> 00:02:17,490 And the Intercept didn't know about it. 33 00:02:17,490 --> 00:02:22,670 And that fingerprint revealed the printer and the time that she had printed it out. 34 00:02:22,710 --> 00:02:27,430 And then the NSA was able to go camera and see who was there at that time. 35 00:02:28,010 --> 00:02:29,070 And she got caught. 36 00:02:29,070 --> 00:02:31,850 And she's now serving time in federal prison. 37 00:02:31,930 --> 00:02:34,690 So, this is an incredibly important topic. 38 00:02:35,450 --> 00:02:46,410 And so, as a journalist and as the technical director of the Truth and Transparency Foundation, anything technical and security or anything like that falls into my bracket. 39 00:02:46,410 --> 00:02:51,890 And I was spending a lot of time cleaning and compressing and optimizing PDF documents. 40 00:02:52,150 --> 00:02:55,390 And I would script it out little by little. 41 00:02:56,150 --> 00:02:59,130 And we launched in 2016. 42 00:02:59,130 --> 00:03:01,190 So, we're coming up on three years of doing this. 43 00:03:01,190 --> 00:03:05,370 And it was extremely tedious. 44 00:03:06,110 --> 00:03:16,730 Even the more when I scripted it out, it seemed like I found a brand new attack vector that I then had to account for and everything. 45 00:03:16,730 --> 00:03:26,290 And anyway, if you look back at our history, we actually released a ton of documents related to the Jehovah's Witnesses. 46 00:03:26,290 --> 00:03:31,070 And the source literally just gave me a hard drive of documents. 47 00:03:31,070 --> 00:03:35,050 And this is all public info because he has admitted to doing it to the press. 48 00:03:35,470 --> 00:03:43,110 And it was tens of thousands of PDFs, so I was like, fuck, I need to automate this. 49 00:03:43,110 --> 00:03:44,590 I'm not going to do this. 50 00:03:44,970 --> 00:03:48,430 And so, that's where Scrubber came into play. 51 00:03:48,750 --> 00:03:58,370 It leverages several tools, PDF tools, OCR and QPDF to clean OCR and linearize PDFs. 52 00:03:59,290 --> 00:04:08,190 The actual code that's cleaning the PDF of the excuse me. 53 00:04:08,270 --> 00:04:14,330 The actual code that's metadata from the PDF and watermarks and stuff like that is in PDF tools. 54 00:04:14,330 --> 00:04:20,470 OCR, my PDF, I'm just using it to put the text layer back. 55 00:04:20,590 --> 00:04:23,410 And I'll go through exactly why I need to put the text layer back. 56 00:04:23,490 --> 00:04:25,670 And then QPDF linearizes it. 57 00:04:26,090 --> 00:04:41,850 And linearizing PDFs is important if you're going to serve them over the web because what it allows you to do is it allows the browser to load one page at a time as you're scrolling through it rather than loading the entire PDF all at once before you can view it. 58 00:04:41,930 --> 00:04:46,890 And sometimes, like, we released PDFs that are hundreds of pages, right? 59 00:04:46,890 --> 00:04:52,750 And after this process, the PDF does get a little larger than your typical file. 60 00:04:52,750 --> 00:04:55,390 So, linearizing it is important for us. 61 00:04:56,130 --> 00:05:06,830 And essentially, Scrubber is just a bash script that's tying all of these tools together and automating the process that I've been doing manually for quite a while. 62 00:05:07,690 --> 00:05:12,770 So, it turns every single page into a PNG using PDF tools. 63 00:05:13,170 --> 00:05:17,010 PDF tools was developed by Micah Lee from the intercept. 64 00:05:18,610 --> 00:05:35,130 And since the reality winner case, they could have gotten past that by converting the PDF into a black and white image because the watermark was so light that it would have been registered as white when you turned the PDF into grayscale. 65 00:05:35,470 --> 00:05:38,330 So, PDF Redactools has that option to be able to get around that. 66 00:05:39,670 --> 00:05:44,710 You can also, so, it turns every single page into an image. 67 00:05:44,790 --> 00:05:51,670 And then if you want to, you can pass it a flag and it will stop in the middle after it's turned the pages into images. 68 00:05:51,710 --> 00:05:55,790 And then you can open them in GIMP and redact them wherever you need to. 69 00:05:55,790 --> 00:05:58,630 And then you can run it again and tell it to merge all the pages. 70 00:05:59,810 --> 00:06:04,330 Combines them into a PDF and stripping any embedded image data. 71 00:06:05,370 --> 00:06:29,550 If you were to go to Google Docs or Microsoft Word and put a JPEG or PNG into that document, you, and then you just download it as a PDF, you could then extract that PDF and potentially get the, extract that image from the PDF and get the metadata that can potentially be identifying and incriminating. 72 00:06:29,550 --> 00:06:34,990 So, what this does is it flattens the entire thing into one image and gets rid of that attack vector. 73 00:06:36,810 --> 00:06:45,130 And then it, because, because it, we turn it into images and then we put it, made it a PDF again, we have to add the OCR layer. 74 00:06:45,130 --> 00:06:50,490 And what the OCR layer is, it's what allows you to copy and paste from a PDF. 75 00:06:50,490 --> 00:06:52,470 It's the text layer, right? 76 00:06:52,470 --> 00:06:55,290 And so, OCR, my PDF leverages Tesseract. 77 00:06:55,430 --> 00:07:04,010 It's an amazing tool and it's funny because Scrubber is actually like a wrapper around several other wrappers around several other tools, right? 78 00:07:04,010 --> 00:07:07,210 So, we're getting pretty, we've got wrappers on wrappers on wrappers here. 79 00:07:08,290 --> 00:07:20,910 But, and then OCR, my PDF will also handle compression, which is super nice and make it, make sure that you're getting the smallest PDF size that you can while still getting a pretty decent quality. 80 00:07:20,910 --> 00:07:30,990 Sometimes you are going to have to sacrifice quality for, for size and whatnot, but, but that's just the name of the game. 81 00:07:30,990 --> 00:07:32,630 I mean, they're, they're always still readable, right? 82 00:07:32,790 --> 00:07:34,010 And that's the important thing. 83 00:07:34,010 --> 00:07:37,750 And then QPDF linearizes it for optimum web browsing. 84 00:07:37,750 --> 00:07:41,390 Like I said, it allows your browser to just load one page at a time rather than the entire PDF. 85 00:07:41,530 --> 00:07:51,830 And then this step is not necessary, but because I'm OCD, um, I still remove all, all the meta, the PDF metadata using Exif tool. 86 00:07:52,110 --> 00:08:02,790 Um, like I said, you don't really have to do that because the meta, the metadata that is in the Exif data that's in there is, um, generic to, and, and unique to this tool. 87 00:08:03,130 --> 00:08:12,990 Um, so this is, um, this is the best part about it, in my opinion, is I've dockerized it and you, and because of that, you could then run it on any operating system. 88 00:08:13,090 --> 00:08:17,030 So, um, essentially I'll go through, I'm going to do a demo here in a minute. 89 00:08:17,070 --> 00:08:24,570 Um, but you, you can clone the repo, run the scripts and it will pull the docker image down from docker hub. 90 00:08:24,570 --> 00:08:38,810 Or if you want to build the docker image locally and you don't want to, um, you don't want to risk your operational security by pulling down from docker hub, you can build it locally and then it'll, and then it'll run it to building locally does take forever because it's a huge ass image. 91 00:08:38,810 --> 00:08:40,090 It's like one and a half gigs. 92 00:08:40,090 --> 00:08:44,850 I'm going to work on decreasing that, but that's, that's where it is now. 93 00:08:44,850 --> 00:08:50,050 It takes about like anywhere from 10 to 30 minutes, depending on how fast your network connection is. 94 00:08:50,650 --> 00:08:54,470 Um, and the, and the, and your CPU processing power. 95 00:08:54,770 --> 00:09:05,570 So essentially you run a script, scrubber.sh, it then, uh, it either pulls down the image, the docker image from docker hub, or you build it locally, uh, starts a docker container. 96 00:09:05,570 --> 00:09:12,550 It runs PDF, redact tools, OCR my PDF, QPF and XF tool, and then it spits it out into an output file. 97 00:09:13,270 --> 00:09:19,410 Um , so the benefits of scrubber is you can run on any, uh, uh, on any operating system. 98 00:09:19,410 --> 00:09:31,650 Thanks to docker, even windows, um, caveat, I've never used docker on windows, so I, uh, that I don't know how hard it is to get installed or anything, but from what I understand, it's, it's pretty simple. 99 00:09:32,390 --> 00:09:36,050 Um, and, uh, it can handle large PDFs. 100 00:09:36,050 --> 00:09:44,470 Um, I have, so PDF redact tools actually leverages image magic to turn, uh, to turn every single page into, uh, into an image. 101 00:09:44,930 --> 00:09:49,590 And if you're doing large PDFs that can get, that can take up your memory quite a bit. 102 00:09:49,590 --> 00:09:52,910 I have it programmed to take up to four gigs of memory. 103 00:09:52,910 --> 00:09:57,590 You can, you could change that up if you need to, you would just have to rebuild the docker image locally. 104 00:09:57,710 --> 00:10:02,470 Um, I have 32 gigs of RAM on my laptop, and so it's not a huge deal, right? 105 00:10:02,470 --> 00:10:17,990 So, um, but, and, and it, and the reason why I have it going up is, is because, uh, thank you, is because I have, um, like I said, we've released PDFs that are hundreds of pages and turning images, hundreds, hundreds of PDF pages into images takes a shit ton of memory. 106 00:10:18,230 --> 00:10:23,990 Um, and then, uh, it provides just a one-stop tool for cleaning and optimization, right? 107 00:10:23,990 --> 00:10:29,310 That was the biggest problem is that like, all right, I can use this tool to clean it. 108 00:10:29,370 --> 00:10:31,610 And then I got to use this tool to optimize it. 109 00:10:31,670 --> 00:10:38,230 And I, and, and I got to use this tool to, for a long time, I didn't even know what OCR was like, to be completely honest with you guys. 110 00:10:38,610 --> 00:10:41,150 Um, and I was like, why isn't the text layer in there? 111 00:10:41,150 --> 00:10:59,250 And I just, I had a naive understanding of PDFs and, uh, and anyway, so I, I really like where this is at because it, yeah, it, it takes the PDF from its state that it got, that we got it from the source and then cleans it and then optimizes it for publishing on the web. 112 00:10:59,270 --> 00:11:01,090 Um, it also supports batches of PDFs. 113 00:11:01,090 --> 00:11:09,710 If you just give it a directory, um, of PDFs, it'll go, it'll go through, um, and, and chain and clean and optimize every single one. 114 00:11:10,130 --> 00:11:16,790 Um, that's the, that's the URL where it's at github.com, truth and transparency slash scrubber. 115 00:11:17,010 --> 00:11:22,290 Um, and let's do a demo really quick here. 116 00:11:22,290 --> 00:11:24,370 I recorded the demo, so don't worry. 117 00:11:27,110 --> 00:11:29,210 You're going to see my cat in this demo. 118 00:11:31,230 --> 00:11:31,850 All right. 119 00:11:31,850 --> 00:11:39,250 So essentially there is a PDF, like I was saying before, that PDF was just, uh, it's got an embedded JPEG of my cat, Lisa. 120 00:11:39,830 --> 00:11:45,110 Um, and, uh, right, right here, what I'm going to do, um, oh, I'm sorry. 121 00:11:45,110 --> 00:11:49,850 You can't really see what I'm doing there, but when I put it on YouTube, you'll be able to see it a whole lot easier. 122 00:11:49,950 --> 00:11:56,690 Um, I'm extracting that, that image of my cat, um, and, and then seeing that the exit data that was in it. 123 00:11:57,070 --> 00:12:06,110 Um, and then what I'm, um, and then I'm showing you that it extracted the single, the single image, and it also extracted the truth and transparency logo as well. 124 00:12:06,690 --> 00:12:11,790 Um, and now I'm going to actually run scrubber on that. 125 00:12:12,670 --> 00:12:21,890 Um, one thing to notice here, um, you can't really see it, but I'm actually passing it, um, the, the full file path. 126 00:12:21,890 --> 00:12:23,290 And that's a mistake on my part. 127 00:12:23,370 --> 00:12:26,170 Um, it doesn't support relative file paths right now. 128 00:12:26,250 --> 00:12:29,510 That is the first thing I'm going to fix in my rush to get this out. 129 00:12:29,510 --> 00:12:31,490 I totally forgot to take that into account. 130 00:12:31,530 --> 00:12:32,610 Um, don't worry. 131 00:12:32,610 --> 00:12:34,690 I already have an issue open on GitHub to take care of it. 132 00:12:34,690 --> 00:12:44,650 So anyway, so now it's going through, you can see this says running PDF for DAC tools, adding the text layer with OCR, my PDF, optimizing it for publication and removing the excess data. 133 00:12:44,830 --> 00:12:47,310 And then, uh, it says your final output is here. 134 00:12:47,310 --> 00:12:50,650 And then right here, I'm running, I'm going to try and extract the images again. 135 00:12:53,770 --> 00:12:55,510 If I could actually type it. 136 00:12:56,770 --> 00:13:04,450 So runs the command and it did extract an image, but you'll see that the image that it extracted is actually the entire PDF itself. 137 00:13:04,450 --> 00:13:07,570 And the it's, it's, it wasn't able to extract it. 138 00:13:07,570 --> 00:13:09,290 And then that's the actual clean version. 139 00:13:09,290 --> 00:13:14,570 And you'll see that that's me highlighting the OCR layer and you will see, um, let me back up a little bit. 140 00:13:14,570 --> 00:13:25,750 You can kind of see in, in my cat's ears here that the quality was kind of compromised a little bit, but, um, it did its job in, in the case of like, uh, being a journalistic source or anything. 141 00:13:25,770 --> 00:13:31,170 Um, you just really kind of need the text and whatnot and get in convey the, uh, the point. 142 00:13:31,170 --> 00:13:35,790 So, um, uh, that's all I really had. 143 00:13:35,790 --> 00:13:39,890 Um, I'm seven minutes early, but I will take as many questions as y'all got. 144 00:13:39,890 --> 00:13:41,730 If not, that's fine too. 145 00:13:43,050 --> 00:13:43,790 Yeah. 146 00:13:44,110 --> 00:13:44,810 All right. 147 00:13:44,810 --> 00:13:45,130 Thank you. 148 00:13:45,130 --> 00:13:45,810 Thank you. 149 00:13:46,230 --> 00:13:47,990 She's got a mic coming for you. 150 00:13:50,090 --> 00:13:51,730 Do you mind coming over here? 151 00:13:58,580 --> 00:14:02,200 Sorry, I was just asking if you could put the contact slide back up real quick. 152 00:14:02,440 --> 00:14:02,700 Yeah. 153 00:14:02,700 --> 00:14:03,600 My contact slide? 154 00:14:03,880 --> 00:14:05,540 Yeah, for sure. 155 00:14:06,180 --> 00:14:07,680 Uh, where did it go? 156 00:14:09,400 --> 00:14:16,800 Um, just to, as you'll see down here, I actually have the roadmap listed and these are things that I want to fix. 157 00:14:16,800 --> 00:14:19,320 And the number one issue is account for relative file paths. 158 00:14:19,800 --> 00:14:24,800 So let me pull the, um, the, uh, contact screen back up here. 159 00:14:25,440 --> 00:14:26,560 There it is. 160 00:14:26,900 --> 00:14:27,560 Yes. 161 00:14:27,560 --> 00:14:28,280 Hello. 162 00:14:28,280 --> 00:14:31,320 Uh, so can you talk a little bit about what you do for other file types? 163 00:14:31,320 --> 00:14:35,320 Like if you get a PPT, do you try to convert everything to PDF and then run this? 164 00:14:35,320 --> 00:14:35,700 Yeah. 165 00:14:35,700 --> 00:14:49,150 I typically as a, as a rule of thumb, like even if I get like a JPEG or, some sort of image file, or like you said, a PowerPoint presentation or something like that, I'll convert it to PDF as best I can without affecting the contents of the file. 166 00:14:49,210 --> 00:14:53,550 Sometimes that can get a little difficult and we have actually released like the raw PPT. 167 00:14:53,610 --> 00:15:11,310 But the reason why we avoid that is because there's, it's way harder to scrub, uh, an office document because Microsoft is terrible, but, um, so, and well, and to, to be fair, PDF is an awful file format as well. 168 00:15:11,310 --> 00:15:11,450 Right. 169 00:15:11,450 --> 00:15:15,950 There's so many, I mean, and the huge disclaimer, I have this in the read me. 170 00:15:15,950 --> 00:15:18,110 This is not a silver bullet by any means, right? 171 00:15:18,110 --> 00:15:23,110 I like, do not expect this to completely protect your sources. 172 00:15:23,410 --> 00:15:23,910 100%. 173 00:15:23,910 --> 00:15:33,010 There's always a potent, there's always a possibility that they're going to, uh, to be identified, but this is definitely a really, really great place to start. 174 00:15:33,450 --> 00:15:34,270 Yeah. 175 00:15:34,710 --> 00:15:43,370 Do you have any plans on, uh, uh, getting it included in like the Debian upstream repos so that it could be used in something like tails? 176 00:15:44,110 --> 00:15:45,350 That would be awesome. 177 00:15:45,350 --> 00:15:50,250 I have not thought about that, but I know who to talk to, to, to see if that can happen. 178 00:15:50,250 --> 00:15:51,370 So that's a good idea. 179 00:15:51,370 --> 00:15:52,130 Thank you. 180 00:15:53,630 --> 00:15:57,810 So this great presentation and thanks for making this tool. 181 00:15:57,810 --> 00:16:10,390 So I could imagine that one response to proliferation of tools like this will just be slightly more insidious, I guess, watermarking kind of patterns and images and things like that. 182 00:16:10,390 --> 00:16:24,970 So is there, do you plan to support an option that's maybe like, I guess you'd call it paranoid mode that basically just extracts, you know, black and whites, everything to prevent encoding and images, removes images, and just tries to keep the text and like... That's a good idea. 183 00:16:24,970 --> 00:16:26,930 I get that would be really easy to do. 184 00:16:26,950 --> 00:16:29,130 Um, that's a great idea actually. 185 00:16:29,190 --> 00:16:30,650 Um, I can definitely do that. 186 00:16:30,650 --> 00:16:34,930 And if you want to help me, I would definitely, that's, I would definitely welcome help on this. 187 00:16:34,930 --> 00:16:36,430 That's the why I open sourced it. 188 00:16:36,530 --> 00:16:38,470 Feel free to submit poll requests. 189 00:16:38,470 --> 00:16:39,650 Um, but yeah, great idea. 190 00:16:39,650 --> 00:16:41,830 I'm definitely going to think about it. 191 00:16:42,230 --> 00:16:43,190 Thank you. 192 00:16:44,310 --> 00:16:54,050 Hey, so it's a really cool tool, but I wonder in scrubbing the file, don't you incidentally also remove authenticity of the file to verify that it's real? 193 00:16:55,330 --> 00:16:55,830 Uh, yeah. 194 00:16:55,830 --> 00:16:57,250 I mean, that's the part of it. 195 00:16:57,250 --> 00:16:58,730 That's the job of a journalist, right? 196 00:16:58,730 --> 00:17:00,210 Is to verify its authenticity. 197 00:17:00,490 --> 00:17:04,170 Um, I mean, and it, and it, I guess it comes down to, do you trust that journalist? 198 00:17:04,170 --> 00:17:04,450 Right. 199 00:17:04,450 --> 00:17:19,450 I mean, there are definitely people who claim to be journalists that I wouldn't trust right away, but like, um, I, and this is, this is something that we get, that we get asked about all the time is how we, uh, verify that the documents are authentic. 200 00:17:20,210 --> 00:17:26,110 Um, and that's not something that we talk about, but it is, that's, that's the job of the journalist and just whether or not you trust them. 201 00:17:26,590 --> 00:17:28,650 So great question though. 202 00:17:30,310 --> 00:17:34,490 Hey, can you put that GitHub link up back up again? 203 00:17:34,490 --> 00:17:34,770 Yep. 204 00:17:34,870 --> 00:17:35,610 There it is. 205 00:17:35,610 --> 00:17:36,350 Oh, thank you. 206 00:17:36,350 --> 00:17:36,630 Yeah. 207 00:17:36,630 --> 00:17:48,810 And, and back to a really quick to your, to your other question too, is it's also the journalist's responsibility, um, to, to disclose, to, to, let's see, what's the word I'm looking for? 208 00:17:48,810 --> 00:18:05,590 Um, inform their reader that they are positive that it's authentic or, and if, and if they can, without risking sources to, to disclose some, like there have been instances in which we, um, have disclosed how we verified it, um, because it wasn't a risk to our sources and stuff like that. 209 00:18:05,590 --> 00:18:08,590 And, and journalists should do that where they can, in my opinion. 210 00:18:08,630 --> 00:18:12,170 Uh, again, I will caveat it with this is I'm not a professional journalist. 211 00:18:12,170 --> 00:18:12,910 I do this on my side. 212 00:18:12,910 --> 00:18:20,110 I try really, really hard to, to do stuff up to a professional caliber, but, um, but yeah, thank you. 213 00:18:20,610 --> 00:18:21,290 All right. 214 00:18:21,490 --> 00:18:22,930 Any more questions? 215 00:18:24,530 --> 00:18:25,190 All right. 216 00:18:25,190 --> 00:18:25,870 Thank you. 217 00:18:25,870 --> 00:18:26,410 Thank you.