“Black marker” effect in the text (sanitization used to hide passwords in code example)

I wonder if there is any LaTeX library that allows me to obtain a sanitization "black marker" effect in order to conceal omissis information, like for example a secret code in an URL or a password in a code listing.

Please have a look at this to get the idea of what I wish to obtain: document with omissis information and here

Any ideas?

-
Do you want to specify the 'black marker' effect by hand in your code or use some 'keywords'? I would use a wrapper command for a colorbox and a boolean flag which is set before compilation whether portions should be 'blackened' or not. I do not know such a package, but there might be such one anyway. – Christian Hupfer Mar 12 '14 at 16:34
@ChristianH. anything that can be useful, any command that may help me. Now that I think about it, a highlighter command set as black may help me achieve this. – fstab Mar 12 '14 at 16:45
There is still one caveat: Do you want to use that document to be printed or just as a .pdf file -- I am not sure, whether 'secret parts' can be nevertheless identified in the pdf code. – Christian Hupfer Mar 12 '14 at 16:54

There also is the Steven B. Se­gletes's censor package (documentation).

You can use \censor{blurg} to censor short pieces of text.

Long paragraphs can be blacked out with \blackout{foo\par bar}.

Censoring can be turned off via \StopCensoring.

\documentclass{article}
\usepackage{censor}

\begin{document}
When shall we \censor{three meet again}, in thunder, lightning or in rain?

Hi \blackout{Hello

Goodbye} Bye

\StopCensoring
When shall we \censor{three meet again}, in thunder, lightning or in rain?
\end{document}


-
I have but one thing to say about your solution: ▓▓▓▓▓▓▓! – Steven B. Segletes Mar 12 '14 at 17:07
@StevenB.Segletes :-) – moewe Mar 12 '14 at 17:08

Depending on whether you want to mark only short strings of text you could do something like this:

\documentclass{article}
\usepackage{calc}
\newif\ifmarksecrets % declare new switch
\marksecretstrue %comment or use \marksecretsfalse to display normal text
\newcommand{\secret}[1]{
\ifmarksecrets % Show black rule
\rule{\widthof{#1}}{\heightof{#1}}
\else % Just display text
#1
\fi
}

\begin{document}
Foo foo foo \secret{VERY SECRET BAR} foo foo foo.
\end{document}


For larger boxes, TikZ can be used to draw anything anywhere on the page, but I'm in a bit of a hurry so I can't provide an example now.

-
One should point out that this solution cannot line break in the middle of the censor. – Steven B. Segletes Mar 12 '14 at 17:10