OK, still can't get a working redaction

View: New views
7 Messages — Rating Filter:   Alert me  

OK, still can't get a working redaction

by David E Nedrow :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm still trying to figure out a mechanism for redacting elements in  
DocBook markup.

Basically, I would like to do something to handle redaction via  
attribute manipulation, such that the following sentence ...

Hi, I'm <personname redact="true"><firstname>David</
firstname><lastname>Nedrow</lastname></personname>.

... renders as ...

Hi, I'm XXXXXXXXXXXX.

Or the variant ...

Hi, I'm <personname><firstname redact="true">David</firstname><  
lastname redact="true">Nedrow</lastname></personname>.

... which renders as ...

Hi, I'm XXXXX XXXXXX.

... where the Xs would render as a solid black field the size of the  
redacted element. Eg., a redacted image would be rendered as a black  
area equal to the dimensions of the image element that would have been  
rendered.

I think my confusion primarily is caused by not being clear on where  
this would actually happen.

I want to keep the actual markup as simple as possible, and handle all  
the processing in my customization layer. So, should I somehow create  
a new attribute as shown above, or a new inline similar to the  
'cleartext' example in DocBook 5 Guide. An attribute that applies to  
certain (or possibly all?) elements would be better in my mind.

The second part of this is, where do I make the magic happen after an  
element to be redacted has been parsed? Would this actually be handled  
by the XSL stylesheets, or the rendering engine (XEP in my case)? Or a  
combination of both.

Is this actually a question for RenderX (XEP vendor)?

-David Nedrow

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: OK, still can't get a working redaction

by Christopher R. Maden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David E Nedrow wrote:
> I'm still trying to figure out a mechanism for redacting elements in
> DocBook markup.

That depends on your delivery mechanism.

You can render text in PDF or HTML in black-on-black, and it will *look*
right, but the text will still be there for people to copy and paste,
search for, etc.  If you are delivering dead trees printed with the PDF,
then the information should be relatively safe.  This would be
relatively easy to implement; a small change to the CSS for HTML, and a
fairly straightforward implementation of the redact attribute in the FO
stylesheets.

You could also try printing a series of non-breaking spaces or Xs in
black-on-black, equal in length to the characters in the elements in
question; the stylesheet customization would be a bit more complicated
for that solution.

(La plus ça change... I remember a certain government agency asking for
this feature in DynaText in 1995 or so...)

~Chris
--
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
“All I ask of living is to have no chains on me,
 And all I ask of dying is to go naturally.” — Laura Nyro
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


RE: OK, still can't get a working redaction

by David Cramer (Tech Pubs) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Use translate() on all text() nodes that are children of *[@redact = 'yes'] to replace the text with Xs:

        <xsl:template match="text()[ancestor::*[@redact='yes']]">
          <xsl:value-of select="translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_=+!@#$%^&*();':"<>,./?', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')"/><!-- Add other chars, e.g. accented chars and other languages, as needed -->
        </xsl:template>

Then do the black-on-black trick in your customization layer/css to make it have the appearance you want.

You might also avoid using ids as filename for html output. The ids could reveal information about the content of the section.

David

-----Original Message-----
From: Christopher R. Maden [mailto:crism@...]
Sent: Tuesday, June 23, 2009 9:28 PM
To: David E Nedrow
Cc: docbook-apps@...
Subject: Re: [docbook-apps] OK, still can't get a working redaction

David E Nedrow wrote:
> I'm still trying to figure out a mechanism for redacting elements in
> DocBook markup.

That depends on your delivery mechanism.

You can render text in PDF or HTML in black-on-black, and it will *look*
right, but the text will still be there for people to copy and paste,
search for, etc.  If you are delivering dead trees printed with the PDF,
then the information should be relatively safe.  This would be
relatively easy to implement; a small change to the CSS for HTML, and a
fairly straightforward implementation of the redact attribute in the FO
stylesheets.

You could also try printing a series of non-breaking spaces or Xs in
black-on-black, equal in length to the characters in the elements in
question; the stylesheet customization would be a bit more complicated
for that solution.

(La plus ça change... I remember a certain government agency asking for
this feature in DynaText in 1995 or so...)

~Chris
--
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
"All I ask of living is to have no chains on me,
 And all I ask of dying is to go naturally." - Laura Nyro
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: OK, still can't get a working redaction

by Philipp Kempgen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David Cramer schrieb:
> Use translate() on all text() nodes that are children of *[@redact = 'yes'] to replace the text with Xs:
>
> <xsl:template match="text()[ancestor::*[@redact='yes']]">
>  <xsl:value-of select="translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_=+!@#$%^&*();':"<>,./?', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')"/><!-- Add other chars, e.g. accented chars and other languages, as needed -->
> </xsl:template>

Wouldn't that break syllabification/hyphenation?
But I guess it's a good solution anyway.

> Then do the black-on-black trick in your customization layer/css to make it have the appearance you want.


    Philipp Kempgen
--
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 ->  http://www.amoocon.de
--

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


RE: OK, still can't get a working redaction

by David Cramer (Tech Pubs) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Wouldn't that break syllabification/hyphenation?
> But I guess it's a good solution anyway.

Well, it doesn't replace the space char with an X so the lines will still wrap fine. You could object that it doesn't hide enough since it reveals the word lengths and location of spaces so that if someone knew enough context perhaps they could deduce something about the contents. To address that you could translate some of the characters to spaces instead of Xs. Is there a specification regarding what counts as a good redaction?

Oh, also I see I put " and ' in my list of characters to translate. You'll need to leave those out (or would replacing them with numeric entities work?).

David

> -----Original Message-----
> From: Philipp Kempgen [mailto:philipp.kempgen@...]
> Sent: Wednesday, June 24, 2009 8:19 AM
> To: docbook-apps@...
> Subject: Re: [docbook-apps] OK, still can't get a working redaction
>
> David Cramer schrieb:
> > Use translate() on all text() nodes that are children of
> *[@redact = 'yes'] to replace the text with Xs:
> >
> > <xsl:template match="text()[ancestor::*[@redact='yes']]">
> >  <xsl:value-of
> select="translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmno
> pqrstuvwxyz1234567890-_=+!@#$%^&*();':"<>,./?',
> 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> XXXXXXXXXXXXXXXXXXXXXXXXX')"/><!-- Add other chars, e.g.
> accented chars and other languages, as needed -->
> > </xsl:template>
>
> Wouldn't that break syllabification/hyphenation?
> But I guess it's a good solution anyway.
>
> > Then do the black-on-black trick in your customization
> layer/css to make it have the appearance you want.
>
>
>     Philipp Kempgen
> --
> AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
> Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
> Asterisk: http://the-asterisk-book.com -
> http://das-asterisk-buch.de Videos of the AMOOCON VoIP
> conference 2009 ->  http://www.amoocon.de
> --
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@...
> For additional commands, e-mail:
> docbook-apps-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: OK, still can't get a working redaction

by David E Nedrow :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jun 24, 2009, at 08:58, David Cramer wrote:

> Use translate() on all text() nodes that are children of *[@redact =  
> 'yes'] to replace the text with Xs:
>
> <xsl:template match="text()[ancestor::*[@redact='yes']]">
>  <xsl:value-of select="translate
> (.,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_=
> +!@#$%^&*();':"<>,./?',  
> 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> ')"/><!-- Add other chars, e.g. accented chars and other languages,  
> as needed -->
> </xsl:template>

This is what Chris had recommended as well, so it may be the way to  
handle it initially. My only problem is that replacing the text with  
X's would slightly change the line layouts when compared to the non-
redacted version. Not a big deal for the project at hand, but it could  
be an issue in other contexts.

> You might also avoid using ids as filename for html output. The ids  
> could reveal information about the content of the section.

Oh, yeah. Good point. I wouldn't normally be outputting HTML for these  
docs, but it's something to keep in mind.

-David

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: OK, still can't get a working redaction

by David E Nedrow :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jun 24, 2009, at 10:23, David Cramer wrote:

>>> Use translate() on all text() nodes that are children of
>> *[@redact = 'yes'] to replace the text with Xs:
>>>
>>> <xsl:template match="text()[ancestor::*[@redact='yes']]">
>>>  <xsl:value-of
>> select="translate(.,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmno
>> pqrstuvwxyz1234567890-_=+!@#$%^&*();':"<>,./?',
>> 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>> XXXXXXXXXXXXXXXXXXXXXXXXX')"/><!-- Add other chars, e.g.
>> accented chars and other languages, as needed -->
>>> </xsl:template>

Oh, the other thing it doesn't handle are elements like <imagedata/>  
that may also need redacted. I suppose for items like that, I could  
simply render "Image Redacted" in place of a black box.

-David

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...