Stories
Slash Boxes
Comments

SoylentNews is people

posted by Fnord666 on Thursday April 05 2018, @08:27PM   Printer-friendly
from the digital-fingerprints dept.

Zero-width characters are invisible, ‘non-printing’ characters that are not displayed by the majority of applications. F​or exam​ple, I’ve ins​erted 10 ze​ro-width spa​ces in​to thi​s sentence, c​an you tel​​l? (Hint: paste the sentence into Diff Checker to see the locations of the characters!). These characters can be used to ‘fingerprint’ text for certain users.

Well, the original reason isn’t too exciting. A few years ago I was a member of a team that participated in competitive tournaments across a variety of video games. This team had a private message board, used to post important announcements amongst other things. Eventually these announcements would appear elsewhere on the web, posted to mock the team and more significantly; ensuring the message board was redundant for sharing confidential information and tactics.

The security of the site seemed pretty tight so the theory was that a logged-in user was simply copying the announcement and posting it elsewhere. I created a script that allowed the team to invisibly fingerprint each announcement with the username of the user it is being displayed to.

I saw a lot of interest in zero-width characters from a recent post by Zach Aysan so I thought I’d publish this method here along with an interactive demo to share with everyone. The code examples have been updated to use modern JavaScript but the overall logic is the same.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Interesting) by takyon on Thursday April 05 2018, @09:58PM (10 children)

    by takyon (881) <takyonNO@SPAMsoylentnews.org> on Thursday April 05 2018, @09:58PM (#663125) Journal

    Arik uses the TT tag. Let's see if that makes a difference:

    Confidential Announcement: ‌​​​‌​‌‌‍‌​​‌‌​‌​‍‌​​​‌‌​​‍‌​​​‌​‌‌‍‌​​‌‌​‌​‍‌​​​‌‌​‌This is some confidential text that you really shouldn't be sharing anywhere else.

    No difference as far as I can tell from the comment preview. The characters are there, but they are hidden.

    Monospace + zero-width = Monospace. Every character in your monospaced text can have 0 or 1 units of width.

    --
    [SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
    Starting Score:    1  point
    Moderation   +1  
       Interesting=1, Total=1
    Extra 'Interesting' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 0) by Anonymous Coward on Thursday April 05 2018, @10:22PM (1 child)

    by Anonymous Coward on Thursday April 05 2018, @10:22PM (#663136)


    Well, there are also full-width characters that take up two columns.
    Such as fullwidth roman characters
    which, if rendered properly, makes these three lines the same width.

    Although it appears that my Firefox does not actually do monospace text right.

    • (Score: 4, Informative) by maxwell demon on Thursday April 05 2018, @10:43PM

      by maxwell demon (1608) on Thursday April 05 2018, @10:43PM (#663152) Journal

      I guess the character set used by default for monospace characters doesn't contain the double-width characters, and the character set used as fallback has a different character width.

      --
      The Tao of math: The numbers you can count are not the real numbers.
  • (Score: 2) by FatPhil on Friday April 06 2018, @06:38AM

    by FatPhil (863) <reversethis-{if.fdsa} {ta} {tnelyos-cp}> on Friday April 06 2018, @06:38AM (#663299) Homepage
    Or width -1: \b! And let's not try to work out what the width of \r is.
    --
    Great minds discuss ideas; average minds discuss events; small minds discuss people; the smallest discuss themselves
  • (Score: 0) by Anonymous Coward on Friday April 06 2018, @11:28AM (2 children)

    by Anonymous Coward on Friday April 06 2018, @11:28AM (#663376)

    tester

  • (Score: 2) by tangomargarine on Friday April 06 2018, @04:23PM (3 children)

    by tangomargarine (667) on Friday April 06 2018, @04:23PM (#663473)

    Monospace + zero-width = Monospace. Every character in your monospaced text can have 0 or 1 units of width.

    So what you're saying is that mono-spaced fonts can have 2 spacings. Marvelous.

    --
    "Is that really true?" "I just spent the last hour telling you to think for yourself! Didn't you hear anything I said?"
    • (Score: 2) by takyon on Friday April 06 2018, @04:31PM (2 children)

      by takyon (881) <takyonNO@SPAMsoylentnews.org> on Friday April 06 2018, @04:31PM (#663477) Journal

      Every character you don't type takes up "space". "Zero space".

      --
      [SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
      • (Score: 2) by tangomargarine on Friday April 06 2018, @06:22PM (1 child)

        by tangomargarine (667) on Friday April 06 2018, @06:22PM (#663502)

        Not the same thing at all.

        --
        "Is that really true?" "I just spent the last hour telling you to think for yourself! Didn't you hear anything I said?"
        • (Score: 2) by Osamabobama on Friday April 06 2018, @10:16PM

          by Osamabobama (5842) on Friday April 06 2018, @10:16PM (#663560)

          It's the difference between looking at the front face of a character, or the side edge. Edge-on, the characters are impossible to see, but they are still there. Unless they aren't there, as suggested above.

          Do modern typesetters get paid by the letter? I smell a scam...

          --
          Appended to the end of comments you post. Max: 120 chars.