Don't use pixelation for redacting text (2022)
bishopfox.com
bishopfox.com
> I’m actually not 100% sure why this happens
It's called sub-pixel rendering or sub-pixel anti-aliasing[1]. Most LCD displays have RGB[2][3] subpixel layouts. Sub-pixel AA takes advantage of this to increase the horizontal resolution of a raster framebuffer by a factor of 3, at the cost of this colour ringing on high-contrast edges such as text—especially on lower-resolution displays. Windows' implementation is called ClearType[4].
It is increasingly less useful as pixel densities increase.
[1]: https://en.wikipedia.org/wiki/Subpixel_rendering
[2]: https://geometrian.com/programming/reference/subpixelzoo/squ...
[3]: https://geometrian.com/programming/reference/subpixelzoo/squ...
[4]: https://learn.microsoft.com/en-gb/typography/cleartype/
Just make sure you don't use a file format which supports history (such as PDF).
If you have to redact with black boxes, the safest way is to redact-rasterise-OCR. That obviously breaks some stuff though and degrades your document quality.
The way this is phrased may give the impression that this is not much of a deal breaker in practical application as long as you just keep it in mind, but it really is.
1. Fill the selected area with a solid color (perhaps an average color of the pixels right outside of the selected area).
2. Write "lorem ipsum dolor sit amet" over that and pixelate the area.
The cryptographers like to say that just because you've created a cryptography scheme strong enough to defeat yourself doesn't mean you've created a strong cryptography scheme. I feel like redaction is much the same. You really need to go with solid, proved techniques, and avoid the proved-weak ones.
If you know it's likely either "guilty" or "not guilty," then the length (regardless of font) will automatically give away which of these two options it is since you can just 'bruteforce' the whole solution set of two options. No in-place redaction will work for a case like that, except possibly a longer one where the whole sentence is redacted and hopefully no one can guess what kind of sentence it was.
It's fairly easy to come up with another algorithm that would "pixelate" text but in a random way that can't be retrieved.
Step 2: Draw whatever censored-looking stuff you want on that now-empty space because you want the censoring to look fancy.
Step 3: Spend some time thinking if step 2 was really worth it or not.
If your redacted documents are to be printed, ensure that you first redact then print. If you must print then redact (let's say you prefer to redact a physical document), photocopy the redacted document and distribute that, so the text cannot be forensically recovered.
Anything else (blurs etc) are prone to reversal or leakage.
To be really safe, you will want to check whether the photocopier forgets about your document after copying. Many photocopiers store documents on hard disks before copying them, and there’s no guarantee that the data is deleted afterwards.
https://www.cbsnews.com/news/digital-photocopiers-loaded-wit...:
“In 2008, Sharp commissioned a survey on copier security that found 60 percent of Americans "don't know" that copiers store images on a hard drive. Sharp tried to warn consumers about the simple act of copying.
"It's falling on deaf ears," McLaughlin said. "Or people don't feel it's important, or 'we'll take care of it later.'"
All the major manufacturers told us they offer security or encryption packages on their products. One product from Sharp automatically erases an image from the hard drive. It costs $500.
But evidence keeps piling up in warehouses that many businesses are unwilling to pay for such protection, and that the average American is completely unaware of the dangers posed by digital copiers.”
(I think selling users that as an add-on is almost criminal. Copiers should make sure documents don’t survive on disk after copying (not even as bits in a now deleted, but not overwritten, file), unless explicitly instructed by the user to do so)
tbh I would be wary of this too; if you use a run-of-the mill office copy station that defaults to color copies you never know what information might leak in the subtle gray scales.
If you need a fool-proof process flatten everything to a 'monochrome' (black and white) image and draw over the redacted areas with a total fill.
This looses text search, but any process that has to understand which objects are being redacted is vastly more complex and thus ripe for errors. Particularly if complex formats like word processor, spreadsheet, or PDF files are involved.
To destroy even length, or possibly stenographic content a transcription and maybe rephrasing might be required. However at that point it's better to go for a summary that avoids the content and know for sure that there's loss of meaning.
Don't use text pixelation to redact sensitive information - https://news.ycombinator.com/item?id=30350626 - Feb 2022 (163 comments)
Is it aesthetically more pleasing?
It isn't, you just use random generated text instead of the actual one, so you get the aesthetic benefit (black bars are ugly) without the leak
(though there is still the issue of leaking length, which might be important for named, e.g. there are only 10 generals, and only one had a very long name, so redacted you still get to guess who that person is, would need to break the formatting of the original to hide that)
2nd Reaction: If it actually can be de-pixelated, then you didn't use large-enough pixels.
Word length can be extremely revealing. A I'd suggest covering the entire document. Plus a large (& random) number of junk pages which you prepend and append to the document. One pixel per page should be fine.