Have you thought about revealing things like non-breaking space, thin space, hair space, and so on? I think at least Fecebutt replaces non-breaking spaces with regular spaces in comments, perhaps precisely to frustrate such steganography. (Ironically, last I recall, they do preserve the difference between double and single spaces, e.g. after periods, which is even more invisible in HTML.)
I second the recommendations of vis, cat -e (or cat -vte), and od -a. I didn't know about hexdump; I always used xxd.
The project is clearly motivated by Be careful what you copy: Invisibly inserting usernames into text[0] (posted 12 hours ago on HN), and many people here might think zero-width characters (or rather, any esoteric Unicode characters) are the only (or the prominent) way to watermark texts, which is wrong. The whole topic -watermarking- is worth at the very least a lengthy blog post, and maybe even several articles, so keep in mind that this comment is just a very brief introduction to different methods (of watermarking)[x]:
(from trivial to more complex ones) ---- 1. Using Invisible Characters The linked[0] article basically talks about a very basic version of it, which should be enough to get the idea. Of course, more sophisticated techniques will use more than just two characters, and will take the position of each invisible character into consideration while encoding & decoding watermarks, ensure it's uniformly distributed throughout the paragraphs etc. Can be defeated by simply removing invisible characters. ---- 2. Using Unicode Characters That Look Alike The same working mechanism as IDN homograph attack[1]. Can be defeated by simply removing "out-of-place" letters/characters, after determining the language of a given text/paragraph/sentence etc. ---- 3. Using Unicode Equivalence > Code point sequences that are defined as canonically equivalent are assumed to have the same appearance and meaning when printed or displayed. For example, the code point U+006E (the Latin lowercase "n") followed by U+0303 (the combining tilde "◌̃") is defined by Unicode to be canonically equivalent to the single code point U+00F1 (the lowercase letter "ñ" of the Spanish alphabet). https://en.wikipedia.org/wiki/Unicode_equivalence Can be defeated by simply normalising the text, and line endings! ---- (Now it's getting harder!) 4. Changing the Layout of Documents You can change (the rendering of):
(a) the margins
(b) the ligatures
(c) the space between
(i) specific characters [kerning]
(ii) consequent words/lines/paragraphs
to embed fingerprints. This is especially dangerous as documents are often leaked by taking screenshots or photocopies, which is secure against Unicode attacks, but not of these.
Can be defeated by copying the plaintext, and pasting it to a text editor, and applying steps 1, 2, 3. Also, bear in mind that if you can still -unintentionally- leak information: (a) when you use a document editor (LibreOffice Writer, Microsoft Word) as the layout engines might act differently depending on your software version, platform, file format etc. (b) paper size (A4, US Letter, ...) ---- 5. Substituting with Synonyms If characters can be replaced by their equivalents, why not replace words or sentences even? Words can be substituted by their synonyms based on an algorithm that can create fingerprints accordingly, and I presume even sentences can be rephrased with the latest advancements in AI/ML. Also, some of the substitutions will be unintentional: a scribble on a piece of leaked document can also leak information about its leaker (different spellings in American and British English, ways of writing date & time, decimal separators etc). Can be defeated by paraphrasing. ---- The list can probably extended even further but this was all I could remember on the top of my head. =) [0]: https://news.ycombinator.com/item?id=16749422 [1]: https://en.wikipedia.org/wiki/IDN_homograph_attack [x]: Not that I'm working in a related field, but I researched watermarking & fingerprinting techniques for a similar but much more extensive project for journalists/whistle-blowers to detect fingerprinting/watermarking in documents. Let me know if you are interested and we can collaborate!
Excellent list. For completion's sake, I'd include intentional typos as an instance of category 5. This can be hard to catch if the typo is in a name. A logical extension of that would be entirely made-up names for non-essential people/places.
At the age of 5, Hawking visited Oxford, incidentally passing through Fakenamingham-on-Watermarkshire. Dictionaries/encyclopedias have been known to insert entirely fake entries as a way of proving ownership.(http://articles.chicagotribune.com/2005-09-21/features/05092...) In the age of ebooks and print-on-demand, those could be tailored to the individual licensee.
Anything like this for VSCode? Just adding option-space accidentally in a ruby file (after an `end`) will cause ruby to explode and not tell you anything. Randomly deleting code until it runs was my only fix.
It feels like you're trying to make a point on that site but I cannot fathom out what that point was. Are you saying zero width spaces are bad? Are you educating people that they exist? It's not all too clear what your point is.
Also I disagree with the following: > If you're working on a website there's a good chance that someone will want to copy/paste it, automate using it, etc. Zero-width spaces will create no end of hassle to those people. I could work around that with literally just 1 line of code:
But these days many HTML parsers will tidy up the output for you so depending on the frameworks you're using, you might not even need to use the above line of code.
> Zero-width spaces will create no end of hassle to those people.
It's up to you to decide what to do with that information. > newString = replace(originalString, "​", " ") If I could have registered "zerowidth.character" I would have. You've got to handle different characters and such. I should say that the site is mainly a joke because we had to use a particular tool which had a bunch of zero width spaces in it, and it got on our nerves.
> If I could have registered "zerowidth.character" I would have. You've got to handle different characters and such.
Ahhh I didn't get that from the site. I thought it was focused on one specific type of zero width character > I should say that the site is mainly a joke because we had to use a particular tool which had a bunch of zero width spaces in it, and it got on our nerves. That's fair enough. :)
Comments (96) 22 threads
Earlier commentsI second the recommendations of vis, cat -e (or cat -vte), and od -a. I didn't know about hexdump; I always used xxd.
(from trivial to more complex ones)
to embed fingerprints. This is especially dangerous as documents are often leaked by taking screenshots or photocopies, which is secure against Unicode attacks, but not of these.----
1. Using Invisible Characters
The linked[0] article basically talks about a very basic version of it, which should be enough to get the idea. Of course, more sophisticated techniques will use more than just two characters, and will take the position of each invisible character into consideration while encoding & decoding watermarks, ensure it's uniformly distributed throughout the paragraphs etc.
Can be defeated by simply removing invisible characters.
----
2. Using Unicode Characters That Look Alike
The same working mechanism as IDN homograph attack[1].
Can be defeated by simply removing "out-of-place" letters/characters, after determining the language of a given text/paragraph/sentence etc.
----
3. Using Unicode Equivalence
> Code point sequences that are defined as canonically equivalent are assumed to have the same appearance and meaning when printed or displayed. For example, the code point U+006E (the Latin lowercase "n") followed by U+0303 (the combining tilde "◌̃") is defined by Unicode to be canonically equivalent to the single code point U+00F1 (the lowercase letter "ñ" of the Spanish alphabet).
https://en.wikipedia.org/wiki/Unicode_equivalence
Can be defeated by simply normalising the text, and line endings!
----
(Now it's getting harder!)
4. Changing the Layout of Documents
You can change (the rendering of):
Can be defeated by copying the plaintext, and pasting it to a text editor, and applying steps 1, 2, 3.
Also, bear in mind that if you can still -unintentionally- leak information:
(a) when you use a document editor (LibreOffice Writer, Microsoft Word) as the layout engines might act differently depending on your software version, platform, file format etc.
(b) paper size (A4, US Letter, ...)
----
5. Substituting with Synonyms
If characters can be replaced by their equivalents, why not replace words or sentences even? Words can be substituted by their synonyms based on an algorithm that can create fingerprints accordingly, and I presume even sentences can be rephrased with the latest advancements in AI/ML.
Also, some of the substitutions will be unintentional: a scribble on a piece of leaked document can also leak information about its leaker (different spellings in American and British English, ways of writing date & time, decimal separators etc).
Can be defeated by paraphrasing.
----
The list can probably extended even further but this was all I could remember on the top of my head. =)
[0]: https://news.ycombinator.com/item?id=16749422
[1]: https://en.wikipedia.org/wiki/IDN_homograph_attack
[x]: Not that I'm working in a related field, but I researched watermarking & fingerprinting techniques for a similar but much more extensive project for journalists/whistle-blowers to detect fingerprinting/watermarking in documents.
Let me know if you are interested and we can collaborate!
At the age of 5, Hawking visited Oxford, incidentally passing through Fakenamingham-on-Watermarkshire.
Dictionaries/encyclopedias have been known to insert entirely fake entries as a way of proving ownership.(http://articles.chicagotribune.com/2005-09-21/features/05092...) In the age of ebooks and print-on-demand, those could be tailored to the individual licensee.
Just like non-existing places/roads on maps, so-called "trap-streets":
https://en.wikipedia.org/wiki/Trap_street
and similar:
https://en.wikipedia.org/wiki/Agloe,_New_York
Also I disagree with the following:
But these days many HTML parsers will tidy up the output for you so depending on the frameworks you're using, you might not even need to use the above line of code.> If you're working on a website there's a good chance that someone will want to copy/paste it, automate using it, etc. Zero-width spaces will create no end of hassle to those people.
I could work around that with literally just 1 line of code:
It's up to you to decide what to do with that information.
> newString = replace(originalString, "​", " ")
If I could have registered "zerowidth.character" I would have. You've got to handle different characters and such.
I should say that the site is mainly a joke because we had to use a particular tool which had a bunch of zero width spaces in it, and it got on our nerves.
Ahhh I didn't get that from the site. I thought it was focused on one specific type of zero width character
> I should say that the site is mainly a joke because we had to use a particular tool which had a bunch of zero width spaces in it, and it got on our nerves.
That's fair enough. :)
All comments shown.
Couldn't load more comments. Check your connection and try again.