Hacker News new | ask | show | jobs
by binaryturtle 80 days ago
When I wrote my own brainf*ck interpreter (in C) at the start of the year I was really struggling to find a use for the language. Eventually I had the idea to obfuscate emails on my websites with the language.

Basically each email gets written as a brainf*ck program and stored in a "data-" attribute. The html only includes a more primitively obfuscated statement "Must enable Javascript to see e-mail." by default which then gets replaced by another brainf*ck interpreter (in JS) with the output of the brainf*ck code. Since we only output ASCII we can reduce the size of the brainf*ck code by always adding 32 to each value it outputs. The Javascript is loaded from what seemingly looks like a 3rd party domain. There we filter basing on heuristics and check if the "referer" matches before sending out the actual interpreter code.

Of course all this would not help if a scraper properly runs things through Javascript too.

Recently I read you soon will be able to run DOOM via CSS, so certainly it should be possible to have a brainf*ck interpreter in CSS? That would be the next step… just to get rid of the Javascript, but then I'm okay with all the downsides of using Javascript just for the e-mail obfuscation.

Anyway… I also regularly (at least once a year) rotate those public contact addresses.

2 comments

How does this approach meaningfully differ from having javascript that XORs the email with a random sequence of bytes stored in that JS?
It's more fun? :)

/edit

And you can combine both approaches: XOR'ing the code first for good measurements. :)

How does that work if the scraper takes a screenshot to feed to a LLM or OCR?
That seems like a very expensive way to crawl the internet
Scrape normally collect emails, if no email seen take screenshot and OCR OCR is cheap and REGEX is cheap
It would be interesting to show bf code rather than the actual email on the webpage. A lot of OCR systems struggle with this kind of repeated symbols where the exact count is required.