Our next speaker will be talking about Scrubber, an open source compilation to protect journalistic sources. Please give a warm welcome to Ethan Gregory Dodge. Thank you. Thank you. I am super excited to be here at the Privacy Village, Privacy Crypto Village. It's one of my very favorite villages and this is my first time speaking at it. 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? So, not talking about crypto today, however, I'm talking about privacy. And let's jump into it because I only got 20 minutes here. So, I'm Ethan Gregory Dodge. I was born and raised Mormon. That has nothing to do with this topic because it's from another slide deck. But I'm a digital forensics professional and I am a journalist. I'm the co-founder of the Truth and Transparency Foundation. And the Truth and Transparency Foundation was originally called Mormon Leaks, which is where my Mormonism comes into play. And we are essentially a nonprofit investigative newsroom dedicated to empowering the disenfranchised by promoting transparency within religious institutions. So, essentially, we get documents from anonymous sources all the time. And I'll tell her story in a second. Well, actually, let's just jump into it. Anyone know who this is? This is a picture of? Who is it? Reality Winner. And what happened to Reality Winner? Right. Right. Yeah. Yeah. So, essentially, what happened was she leaked a document to the Intercept and she printed it out. And the printer had left a fingerprint or a watermark that was nearly invisible. And she scanned it in and sent it to the Intercept. And the Intercept didn't know about it. And that fingerprint revealed the printer and the time that she had printed it out. And then the NSA was able to go camera and see who was there at that time. And she got caught. And she's now serving time in federal prison. So, this is an incredibly important topic. 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. And I was spending a lot of time cleaning and compressing and optimizing PDF documents. And I would script it out little by little. And we launched in 2016. So, we're coming up on three years of doing this. And it was extremely tedious. 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. And anyway, if you look back at our history, we actually released a ton of documents related to the Jehovah's Witnesses. And the source literally just gave me a hard drive of documents. And this is all public info because he has admitted to doing it to the press. And it was tens of thousands of PDFs, so I was like, fuck, I need to automate this. I'm not going to do this. And so, that's where Scrubber came into play. It leverages several tools, PDF tools, OCR and QPDF to clean OCR and linearize PDFs. The actual code that's cleaning the PDF of the excuse me. The actual code that's metadata from the PDF and watermarks and stuff like that is in PDF tools. OCR, my PDF, I'm just using it to put the text layer back. And I'll go through exactly why I need to put the text layer back. And then QPDF linearizes it. 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. And sometimes, like, we released PDFs that are hundreds of pages, right? And after this process, the PDF does get a little larger than your typical file. So, linearizing it is important for us. 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. So, it turns every single page into a PNG using PDF tools. PDF tools was developed by Micah Lee from the intercept. 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. So, PDF Redactools has that option to be able to get around that. You can also, so, it turns every single page into an image. 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. And then you can open them in GIMP and redact them wherever you need to. And then you can run it again and tell it to merge all the pages. Combines them into a PDF and stripping any embedded image data. 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. So, what this does is it flattens the entire thing into one image and gets rid of that attack vector. 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. And what the OCR layer is, it's what allows you to copy and paste from a PDF. It's the text layer, right? And so, OCR, my PDF leverages Tesseract. 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? So, we're getting pretty, we've got wrappers on wrappers on wrappers here. 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. Sometimes you are going to have to sacrifice quality for, for size and whatnot, but, but that's just the name of the game. I mean, they're, they're always still readable, right? And that's the important thing. And then QPDF linearizes it for optimum web browsing. Like I said, it allows your browser to just load one page at a time rather than the entire PDF. 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. 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. 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. So, um, essentially I'll go through, I'm going to do a demo here in a minute. Um, but you, you can clone the repo, run the scripts and it will pull the docker image down from docker hub. 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. It's like one and a half gigs. I'm going to work on decreasing that, but that's, that's where it is now. It takes about like anywhere from 10 to 30 minutes, depending on how fast your network connection is. Um, and the, and the, and your CPU processing power. 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. It runs PDF, redact tools, OCR my PDF, QPF and XF tool, and then it spits it out into an output file. Um, so the benefits of scrubber is you can run on any, uh, uh, on any operating system. 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. Um, and, uh, it can handle large PDFs. Um, I have, so PDF redact tools actually leverages image magic to turn, uh, to turn every single page into, uh, into an image. And if you're doing large PDFs that can get, that can take up your memory quite a bit. I have it programmed to take up to four gigs of memory. You can, you could change that up if you need to, you would just have to rebuild the docker image locally. Um, I have 32 gigs of RAM on my laptop, and so it's not a huge deal, right? 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. Um, and then, uh, it provides just a one-stop tool for cleaning and optimization, right? That was the biggest problem is that like, all right, I can use this tool to clean it. And then I got to use this tool to optimize it. 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. Um, and I was like, why isn't the text layer in there? 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. Um, it also supports batches of PDFs. 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. Um, that's the, that's the URL where it's at github.com, truth and transparency slash scrubber. Um, and let's do a demo really quick here. I recorded the demo, so don't worry. You're going to see my cat in this demo. All right. 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. Um, and, uh, right, right here, what I'm going to do, um, oh, I'm sorry. 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. Um, I'm extracting that, that image of my cat, um, and, and then seeing that the exit data that was in it. 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. Um, and now I'm going to actually run scrubber on that. 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. And that's a mistake on my part. Um, it doesn't support relative file paths right now. That is the first thing I'm going to fix in my rush to get this out. I totally forgot to take that into account. Um, don't worry. I already have an issue open on GitHub to take care of it. 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. And then, uh, it says your final output is here. And then right here, I'm running, I'm going to try and extract the images again. If I could actually type it. 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. And the it's, it's, it wasn't able to extract it. And then that's the actual clean version. And you'll see that that's me highlighting the OCR layer and you will see, um, let me back up a little bit. 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. Um, you just really kind of need the text and whatnot and get in convey the, uh, the point. So, um, uh, that's all I really had. Um, I'm seven minutes early, but I will take as many questions as y'all got. If not, that's fine too. Yeah. All right. Thank you. Thank you. She's got a mic coming for you. Do you mind coming over here? Sorry, I was just asking if you could put the contact slide back up real quick. Yeah. My contact slide? Yeah, for sure. Uh, where did it go? Um, just to, as you'll see down here, I actually have the roadmap listed and these are things that I want to fix. And the number one issue is account for relative file paths. So let me pull the, um, the, uh, contact screen back up here. There it is. Yes. Hello. Uh, so can you talk a little bit about what you do for other file types? Like if you get a PPT, do you try to convert everything to PDF and then run this? Yeah. 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. Sometimes that can get a little difficult and we have actually released like the raw PPT. 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. Right. There's so many, I mean, and the huge disclaimer, I have this in the read me. This is not a silver bullet by any means, right? I like, do not expect this to completely protect your sources. 100%. 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. Yeah. 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? That would be awesome. I have not thought about that, but I know who to talk to, to, to see if that can happen. So that's a good idea. Thank you. So this great presentation and thanks for making this tool. 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. 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. I get that would be really easy to do. Um, that's a great idea actually. Um, I can definitely do that. And if you want to help me, I would definitely, that's, I would definitely welcome help on this. That's the why I open sourced it. Feel free to submit poll requests. Um, but yeah, great idea. I'm definitely going to think about it. Thank you. 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? Uh, yeah. I mean, that's the part of it. That's the job of a journalist, right? Is to verify its authenticity. Um, I mean, and it, and it, I guess it comes down to, do you trust that journalist? Right. 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. 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. So great question though. Hey, can you put that GitHub link up back up again? Yep. There it is. Oh, thank you. Yeah. 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? 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. And, and journalists should do that where they can, in my opinion. Uh, again, I will caveat it with this is I'm not a professional journalist. I do this on my side. I try really, really hard to, to do stuff up to a professional caliber, but, um, but yeah, thank you. All right. Any more questions? All right. Thank you. Thank you.