The aim is to avoid article easily copied by Web crawlers.

  1. Cipher the text with a substitute cipher.
  2. Generate a font that counteracts the substitution and transfer to Web front-end. (This works by having text characters render as their substitute instead of their actual character.)
  3. When the browser render text with this font, the user can read the actual text directly.
  4. Users read as usual. Crawlers see gibberish. Goal Achieved.
  • Yes, but I think you'd be better off by either detecting crawlers - there are several libraries out there - or using Javascript to keep out the worst offenders. Consider that if you disable crawlers, your articles will be unlikely to be found.
    – LSerni
    Sep 5, 2017 at 6:49
  • 1
    He's saying that he wants to make a font that "A" looks like "M". The text would be rendered with, say, a ROT13 so all that a text parser would get is garbage, but it would be human readable as the custom font would display the result of the shift. Users would read the correct letter, but computers would see the wrong thing. This could actually be an interesting anti-spam technique as well to disguise some of the input boxes for registration. Sep 5, 2017 at 13:37
  • What do you mean by "counteracts the substitution"? That's not clear.
    – A. Hersean
    Sep 5, 2017 at 14:08

3 Answers 3


It is not quite clear how you exactly imagine it. But given the description so far I assume that you just map for example the character "Z" to something shaped "A" and then replace every A in your page with Z which will be displayed as A on screen due to the special font.

Apart from being a nightmare for any user relying on screen reading it is probably easy to crack to: For one one could use OCR to find the real text, compare this with the HTML source code and thus build a mapping between source code character and displayed character. Even this might not be needed because one could do some statistical analysis of the HTML source code and some comparison again a dictionary to get the mapping between source code character and displayed character because this is essentially just a substitution cipher based on single letters.

This font is create with some One Time Pad key.

I'm not sure what you really mean with this. But it might mean that every mapping between character in source code and displayed character is done only once instead of reusing the same mapping all the time as I've described above. While you don't have an easy to crack substitution cipher this way it means that you would need a lot of fonts for each HTML page. This would be even more be a usability nightmare than with a single font. But, OCR could still be used to extract the text. Essentially the protection is about the same as you would just make a photo of the page and just put this photo online.

Thus essentially: it makes it a bit harder for web crawlers but at the cost of making it harder for end users too.

  • The point is. It's One Time Pad, so I think statistical analysis is quite difficult. OCR is a burden for the crawler. Yes, hard for end users, but only additional font transfer.
    – Donald Wu
    Sep 5, 2017 at 7:00
  • 1
    @S.L.Barth: I've updated the answer to reflect this. Sep 5, 2017 at 7:03
  • 1
    @DonaldWu: why just make it this complex and not just post a photo of the page? Same usability problems, same protection, less complexity. *"... but only additional font transfer" - that's actually a lot because you would need a new shape for each character in your source code. Sep 5, 2017 at 7:04

Updated answer:

Your question is far more clear now that you reformulated it. You are describing a monoalphabetic substitution cipher: each letter is encoded by another code-point than with the classical ASCII or UTF-8 encoding (assuming english text).

This will make common bot unable to correctly parse the textual content of the web pages. However, this cipher is easily broken by statistical analysis or by knowing a part of the plaintext. Thus, it would be relatively easy to write a bot (or improve a web crawler) to automatically decrypt most of your webpages.

Original answer:

I will answer you question point by point.

Is it practicable to encrypt text with sophisticatedly designed font?

No. Because this is not how encryption works. What you are asking is just impossible.

The aim is to avoid article easily copied by Web crawlers.

Web crawlers do not care about the font you are choosing. They do not have eyes.

Despite that font can be decompiled, is it practical to encrypt text with sophisticatedly designed font? ( font and ciphertext are both provided )

You can obfuscate or encode a rendered text with a special font, but that is not an encryption. At most it is a substitution cipher, that does not offer any real security. Besides, the cipher text is the output of an encryption algorithm, not its input. If you already have an encrypted text, why would you want to encrypt it again?

This font is create with some One Time Pad key.

One time pad is not an encryption protocol, it is an impractical encryption algorithm. Moreover, in any encryption mechanism, you need to give the decryption key to the ones decrypting the message, how do you plan to give this key only to the intended readers and not to the web crawlers?

To sum up, I do not think that you understand what you are asking about. I suggest you read about:

  • how a page is encoded (HTML),
  • what is a font,
  • what is encryption.

For the last point, I suggest that you read about the Enigma machine, because you can find a lot of very well written articles and books about it that will explain to you the fundamentals of encryption.

  • 1
    Describing it as "encryption" was an error, but it's precisely relying on the fact that crawlers do not have eyes. He wants to make it so giberish displays as readable text by having a font where the letters don't match with the unicode character backing them. The plaintext of the page would look like "Mattr" but when the font was applied, it would look like "Hello". Short of rendering and OCRing the document, this would be an effective anti-bot technique but would have issues for accessibility. Sep 5, 2017 at 13:40

Describing this as "encryption" is a major stretch and I would question the value in doing anything more complicated than a rot 13. I suggest this because it is unlikely a crawler will bother trying to counteract your particular approach unless you have content that would directly attract specialized attention. Using ROT13 should therefore be just as effective as the much harder task of adding a render layer and dynamically generating a font that has to be loaded to view the page.

The idea of a one time pad is also irrelevant as by definition a OTP can not repeat a shift, but your font is going to be used for the entire text. This means that an (easily) analysable pattern will be formed. I suppose you could render different fonts for each repeat character, but that is going to be extremely data intensive and processing intensive to generate all those fonts on the fly for basically no practical value. (Particularly since rendering and OCRing provides a perfectly effective countermeasure for a determined or sophisticated adversary.)

It won't provide any security beyond protection against machine readability, but it should be highlighted this has severe accessibility costs as well as any screen reader (what blind people use for using a computer) depends on the content being machine readable to function. You would be blocking any users dependent on a screen reader from accessing your site. You might be able to somewhat get around this by allowing registered users to use a non-scrambled font though so that it would be machine readable and taking precautions against allowing robots to register.

This might also be useful as an anti-spam (bot registration) mechanism as well. You could use it to disguise some of the inputs on registration to make it harder to create a valid response without manual intervention. This would fall victim to the same accessibility issues, but you could provide some alternative registration path (such as manual approval) for someone who needs screen reader support.

Not the answer you're looking for? Browse other questions tagged .