WEBVTT

00:00.000 --> 00:05.460
Our next speaker will be talking about Scrubber, an open source compilation to protect journalistic sources.

00:05.460 --> 00:08.120
Please give a warm welcome to Ethan Gregory Dodge.

00:12.250 --> 00:13.310
Thank you.

00:13.310 --> 00:14.370
Thank you.

00:14.490 --> 00:20.390
I am super excited to be here at the Privacy Village, Privacy Crypto Village.

00:20.930 --> 00:24.290
It's one of my very favorite villages and this is my first time speaking at it.

00:24.510 --> 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?

00:32.170 --> 00:37.450
So, not talking about crypto today, however, I'm talking about privacy.

00:38.710 --> 00:41.330
And let's jump into it because I only got 20 minutes here.

00:41.330 --> 00:44.890
So, I'm Ethan Gregory Dodge.

00:44.890 --> 00:46.410
I was born and raised Mormon.

00:46.410 --> 00:51.230
That has nothing to do with this topic because it's from another slide deck.

00:51.230 --> 00:55.450
But I'm a digital forensics professional and I am a journalist.

00:55.450 --> 00:57.930
I'm the co-founder of the Truth and Transparency Foundation.

00:57.930 --> 01:03.470
And the Truth and Transparency Foundation was originally called Mormon Leaks, which is where my Mormonism comes into play.

01:05.050 --> 01:13.910
And we are essentially a nonprofit investigative newsroom dedicated to empowering the disenfranchised by promoting transparency within religious institutions.

01:14.950 --> 01:20.390
So, essentially, we get documents from anonymous sources all the time.

01:20.470 --> 01:24.950
And I'll tell her story in a second.

01:24.950 --> 01:26.690
Well, actually, let's just jump into it.

01:26.690 --> 01:28.710
Anyone know who this is?

01:28.970 --> 01:30.110
This is a picture of?

01:30.110 --> 01:30.930
Who is it?

01:31.510 --> 01:32.370
Reality Winner.

01:32.370 --> 01:34.030
And what happened to Reality Winner?

01:53.190 --> 01:54.190
Right.

01:55.210 --> 01:56.090
Right.

01:57.750 --> 01:58.690
Yeah.

01:58.910 --> 01:59.530
Yeah.

01:59.530 --> 02:04.970
So, essentially, what happened was she leaked a document to the Intercept and she printed it out.

02:05.350 --> 02:12.890
And the printer had left a fingerprint or a watermark that was nearly invisible.

02:13.030 --> 02:14.890
And she scanned it in and sent it to the Intercept.

02:14.890 --> 02:17.490
And the Intercept didn't know about it.

02:17.490 --> 02:22.670
And that fingerprint revealed the printer and the time that she had printed it out.

02:22.710 --> 02:27.430
And then the NSA was able to go camera and see who was there at that time.

02:28.010 --> 02:29.070
And she got caught.

02:29.070 --> 02:31.850
And she's now serving time in federal prison.

02:31.930 --> 02:34.690
So, this is an incredibly important topic.

02:35.450 --> 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.

02:46.410 --> 02:51.890
And I was spending a lot of time cleaning and compressing and optimizing PDF documents.

02:52.150 --> 02:55.390
And I would script it out little by little.

02:56.150 --> 02:59.130
And we launched in 2016.

02:59.130 --> 03:01.190
So, we're coming up on three years of doing this.

03:01.190 --> 03:05.370
And it was extremely tedious.

03:06.110 --> 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.

03:16.730 --> 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.

03:26.290 --> 03:31.070
And the source literally just gave me a hard drive of documents.

03:31.070 --> 03:35.050
And this is all public info because he has admitted to doing it to the press.

03:35.470 --> 03:43.110
And it was tens of thousands of PDFs, so I was like, fuck, I need to automate this.

03:43.110 --> 03:44.590
I'm not going to do this.

03:44.970 --> 03:48.430
And so, that's where Scrubber came into play.

03:48.750 --> 03:58.370
It leverages several tools, PDF tools, OCR and QPDF to clean OCR and linearize PDFs.

03:59.290 --> 04:08.190
The actual code that's cleaning the PDF of the excuse me.

04:08.270 --> 04:14.330
The actual code that's metadata from the PDF and watermarks and stuff like that is in PDF tools.

04:14.330 --> 04:20.470
OCR, my PDF, I'm just using it to put the text layer back.

04:20.590 --> 04:23.410
And I'll go through exactly why I need to put the text layer back.

04:23.490 --> 04:25.670
And then QPDF linearizes it.

04:26.090 --> 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.

04:41.930 --> 04:46.890
And sometimes, like, we released PDFs that are hundreds of pages, right?

04:46.890 --> 04:52.750
And after this process, the PDF does get a little larger than your typical file.

04:52.750 --> 04:55.390
So, linearizing it is important for us.

04:56.130 --> 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.

05:07.690 --> 05:12.770
So, it turns every single page into a PNG using PDF tools.

05:13.170 --> 05:17.010
PDF tools was developed by Micah Lee from the intercept.

05:18.610 --> 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.

05:35.470 --> 05:38.330
So, PDF Redactools has that option to be able to get around that.

05:39.670 --> 05:44.710
You can also, so, it turns every single page into an image.

05:44.790 --> 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.

05:51.710 --> 05:55.790
And then you can open them in GIMP and redact them wherever you need to.

05:55.790 --> 05:58.630
And then you can run it again and tell it to merge all the pages.

05:59.810 --> 06:04.330
Combines them into a PDF and stripping any embedded image data.

06:05.370 --> 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.

06:29.550 --> 06:34.990
So, what this does is it flattens the entire thing into one image and gets rid of that attack vector.

06:36.810 --> 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.

06:45.130 --> 06:50.490
And what the OCR layer is, it's what allows you to copy and paste from a PDF.

06:50.490 --> 06:52.470
It's the text layer, right?

06:52.470 --> 06:55.290
And so, OCR, my PDF leverages Tesseract.

06:55.430 --> 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?

07:04.010 --> 07:07.210
So, we're getting pretty, we've got wrappers on wrappers on wrappers here.

07:08.290 --> 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.

07:20.910 --> 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.

07:30.990 --> 07:32.630
I mean, they're, they're always still readable, right?

07:32.790 --> 07:34.010
And that's the important thing.

07:34.010 --> 07:37.750
And then QPDF linearizes it for optimum web browsing.

07:37.750 --> 07:41.390
Like I said, it allows your browser to just load one page at a time rather than the entire PDF.

07:41.530 --> 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.

07:52.110 --> 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.

08:03.130 --> 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.

08:13.090 --> 08:17.030
So, um, essentially I'll go through, I'm going to do a demo here in a minute.

08:17.070 --> 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.

08:24.570 --> 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.

08:38.810 --> 08:40.090
It's like one and a half gigs.

08:40.090 --> 08:44.850
I'm going to work on decreasing that, but that's, that's where it is now.

08:44.850 --> 08:50.050
It takes about like anywhere from 10 to 30 minutes, depending on how fast your network connection is.

08:50.650 --> 08:54.470
Um, and the, and the, and your CPU processing power.

08:54.770 --> 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.

09:05.570 --> 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.

09:13.270 --> 09:19.410
Um , so the benefits of scrubber is you can run on any, uh, uh, on any operating system.

09:19.410 --> 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.

09:32.390 --> 09:36.050
Um, and, uh, it can handle large PDFs.

09:36.050 --> 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.

09:44.930 --> 09:49.590
And if you're doing large PDFs that can get, that can take up your memory quite a bit.

09:49.590 --> 09:52.910
I have it programmed to take up to four gigs of memory.

09:52.910 --> 09:57.590
You can, you could change that up if you need to, you would just have to rebuild the docker image locally.

09:57.710 --> 10:02.470
Um, I have 32 gigs of RAM on my laptop, and so it's not a huge deal, right?

10:02.470 --> 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.

10:18.230 --> 10:23.990
Um, and then, uh, it provides just a one-stop tool for cleaning and optimization, right?

10:23.990 --> 10:29.310
That was the biggest problem is that like, all right, I can use this tool to clean it.

10:29.370 --> 10:31.610
And then I got to use this tool to optimize it.

10:31.670 --> 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.

10:38.610 --> 10:41.150
Um, and I was like, why isn't the text layer in there?

10:41.150 --> 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.

10:59.270 --> 11:01.090
Um, it also supports batches of PDFs.

11:01.090 --> 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.

11:10.130 --> 11:16.790
Um, that's the, that's the URL where it's at github.com, truth and transparency slash scrubber.

11:17.010 --> 11:22.290
Um, and let's do a demo really quick here.

11:22.290 --> 11:24.370
I recorded the demo, so don't worry.

11:27.110 --> 11:29.210
You're going to see my cat in this demo.

11:31.230 --> 11:31.850
All right.

11:31.850 --> 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.

11:39.830 --> 11:45.110
Um, and, uh, right, right here, what I'm going to do, um, oh, I'm sorry.

11:45.110 --> 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.

11:49.950 --> 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.

11:57.070 --> 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.

12:06.690 --> 12:11.790
Um, and now I'm going to actually run scrubber on that.

12:12.670 --> 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.

12:21.890 --> 12:23.290
And that's a mistake on my part.

12:23.370 --> 12:26.170
Um, it doesn't support relative file paths right now.

12:26.250 --> 12:29.510
That is the first thing I'm going to fix in my rush to get this out.

12:29.510 --> 12:31.490
I totally forgot to take that into account.

12:31.530 --> 12:32.610
Um, don't worry.

12:32.610 --> 12:34.690
I already have an issue open on GitHub to take care of it.

12:34.690 --> 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.

12:44.830 --> 12:47.310
And then, uh, it says your final output is here.

12:47.310 --> 12:50.650
And then right here, I'm running, I'm going to try and extract the images again.

12:53.770 --> 12:55.510
If I could actually type it.

12:56.770 --> 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.

13:04.450 --> 13:07.570
And the it's, it's, it wasn't able to extract it.

13:07.570 --> 13:09.290
And then that's the actual clean version.

13:09.290 --> 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.

13:14.570 --> 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.

13:25.770 --> 13:31.170
Um, you just really kind of need the text and whatnot and get in convey the, uh, the point.

13:31.170 --> 13:35.790
So, um, uh, that's all I really had.

13:35.790 --> 13:39.890
Um, I'm seven minutes early, but I will take as many questions as y'all got.

13:39.890 --> 13:41.730
If not, that's fine too.

13:43.050 --> 13:43.790
Yeah.

13:44.110 --> 13:44.810
All right.

13:44.810 --> 13:45.130
Thank you.

13:45.130 --> 13:45.810
Thank you.

13:46.230 --> 13:47.990
She's got a mic coming for you.

13:50.090 --> 13:51.730
Do you mind coming over here?

13:58.580 --> 14:02.200
Sorry, I was just asking if you could put the contact slide back up real quick.

14:02.440 --> 14:02.700
Yeah.

14:02.700 --> 14:03.600
My contact slide?

14:03.880 --> 14:05.540
Yeah, for sure.

14:06.180 --> 14:07.680
Uh, where did it go?

14:09.400 --> 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.

14:16.800 --> 14:19.320
And the number one issue is account for relative file paths.

14:19.800 --> 14:24.800
So let me pull the, um, the, uh, contact screen back up here.

14:25.440 --> 14:26.560
There it is.

14:26.900 --> 14:27.560
Yes.

14:27.560 --> 14:28.280
Hello.

14:28.280 --> 14:31.320
Uh, so can you talk a little bit about what you do for other file types?

14:31.320 --> 14:35.320
Like if you get a PPT, do you try to convert everything to PDF and then run this?

14:35.320 --> 14:35.700
Yeah.

14:35.700 --> 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.

14:49.210 --> 14:53.550
Sometimes that can get a little difficult and we have actually released like the raw PPT.

14:53.610 --> 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.

15:11.310 --> 15:11.450
Right.

15:11.450 --> 15:15.950
There's so many, I mean, and the huge disclaimer, I have this in the read me.

15:15.950 --> 15:18.110
This is not a silver bullet by any means, right?

15:18.110 --> 15:23.110
I like, do not expect this to completely protect your sources.

15:23.410 --> 15:23.910
100%.

15:23.910 --> 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.

15:33.450 --> 15:34.270
Yeah.

15:34.710 --> 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?

15:44.110 --> 15:45.350
That would be awesome.

15:45.350 --> 15:50.250
I have not thought about that, but I know who to talk to, to, to see if that can happen.

15:50.250 --> 15:51.370
So that's a good idea.

15:51.370 --> 15:52.130
Thank you.

15:53.630 --> 15:57.810
So this great presentation and thanks for making this tool.

15:57.810 --> 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.

16:10.390 --> 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.

16:24.970 --> 16:26.930
I get that would be really easy to do.

16:26.950 --> 16:29.130
Um, that's a great idea actually.

16:29.190 --> 16:30.650
Um, I can definitely do that.

16:30.650 --> 16:34.930
And if you want to help me, I would definitely, that's, I would definitely welcome help on this.

16:34.930 --> 16:36.430
That's the why I open sourced it.

16:36.530 --> 16:38.470
Feel free to submit poll requests.

16:38.470 --> 16:39.650
Um, but yeah, great idea.

16:39.650 --> 16:41.830
I'm definitely going to think about it.

16:42.230 --> 16:43.190
Thank you.

16:44.310 --> 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?

16:55.330 --> 16:55.830
Uh, yeah.

16:55.830 --> 16:57.250
I mean, that's the part of it.

16:57.250 --> 16:58.730
That's the job of a journalist, right?

16:58.730 --> 17:00.210
Is to verify its authenticity.

17:00.490 --> 17:04.170
Um, I mean, and it, and it, I guess it comes down to, do you trust that journalist?

17:04.170 --> 17:04.450
Right.

17:04.450 --> 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.

17:20.210 --> 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.

17:26.590 --> 17:28.650
So great question though.

17:30.310 --> 17:34.490
Hey, can you put that GitHub link up back up again?

17:34.490 --> 17:34.770
Yep.

17:34.870 --> 17:35.610
There it is.

17:35.610 --> 17:36.350
Oh, thank you.

17:36.350 --> 17:36.630
Yeah.

17:36.630 --> 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?

17:48.810 --> 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.

18:05.590 --> 18:08.590
And, and journalists should do that where they can, in my opinion.

18:08.630 --> 18:12.170
Uh, again, I will caveat it with this is I'm not a professional journalist.

18:12.170 --> 18:12.910
I do this on my side.

18:12.910 --> 18:20.110
I try really, really hard to, to do stuff up to a professional caliber, but, um, but yeah, thank you.

18:20.610 --> 18:21.290
All right.

18:21.490 --> 18:22.930
Any more questions?

18:24.530 --> 18:25.190
All right.

18:25.190 --> 18:25.870
Thank you.

18:25.870 --> 18:26.410
Thank you.

