The best way to redact a document in practice is not to go over it with blur or black boxes, but to completely delete the text you want to redact, and replace it with a placeholder such as REDACTED. This means you won't leak length or anything else. Of course, it can change formatting and page numbers, so it's worth being mindful of that.
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.