Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    A

    Alf.nu

    alf.nu · Personal blog · on HN since 2016

    Alf.nu hosts small browser-based programming puzzles and security demos, including Regex Golf, Return True to Win and a SHA-1 collider.

    Visit blogHN submissions
    ProgrammingWeb DevelopmentGames
    What HN says

    Commenters recommend its Regex Golf and Return True to Win games as enjoyable ways to learn regular expressions and JavaScript quirks.

    Stats for nerds
    36HN people shared it
    14linked in comments
    561story points
    May 2025last shared
    2016people per year2025

    Top posts on HN

    1. 1
      SHA-1 collider: Make your own colliding PDFs
      5 people · 299 points · first shared 2017 · 98 comments on HN
    2. 2
      Return True to Win
      10 people · 251 points · first shared 2016 · 116 comments on HN
    3. 3
      Regex Golf
      11 people · 7 points · first shared 2016 · 1 comments on HN
    4. 4
      Zip Quine
      5 people · 2 points · first shared 2016 · Discussion on HN
    5. 5
      Unicode search
      1 person · 2 points · first shared 2016 · Discussion on HN
    6. 6
      Alert1
      2 people · first shared 2020
    7. 7
      ServiceWorker
      1 person · first shared 2016
    8. 8
      RegexGolf
      1 person · first shared 2025
    9. 9
      ReturnTrue
      1 person · first shared 2024

    What HN people wrote when they linked it

    • patcheudorFeb 2017

      >I'm also sure that SHA-1 remains pervasive in many codebases

      I've done a lot of security reviews of backup solutions over the years and nearly universally they use SHA1 for de-duplication. Security professionals have been providing warnings about this practice, but when you are dealing with a cloud backup solution as an example, speed and low compute requirements are a must and it's hard to win the argument when someone tosses "theoretical" onto the table. Well, we are now past "theoretical" and that's what matters.

      I just tried out the SHA1 collider: https://alf.nu/SHA1 and created two PDFs containing entirely different bits of text in JPGs. It took seconds and indeed the output of the files were SHA1 identical. This is no longer nation-state level stuff and computing colliding documents to upload to cloud backup providers who de-dupe across the file system and not just restricted within the boundaries of each account could result in the ability to wipe out and change other people's data. At a minimum that could be an annoyance. At worst, it could result in the intentional change of someone's content to cause significant financial or physical harm.

    • abbeyjDec 2019

      This was pretty enjoyable. It reminds me a bit of "return true to win" (https://alf.nu/ReturnTrue).

      I think I cheated a bit on Level 7. I just copy-pasted the code that wrote to epochComms and changed it to write to interceptComms instead. I'm not quite sure what the intended solution is.

      On Level 12, does Secret.extHash serve any purpose? It never gets read.

      I was doing this on mobile (Chrome on Android) and I ran into a few odd problems. If you have two opening curly braces in a row and try to backspace to delete the first one, it instead inserts a newline and duplicates the rest of the line. That is, if you have "{{foo" with the cursor after the first curly brace and you press backspace you end up with two lines each saying "{foo". This doesn't happen for me on desktop.

      Copy-paste also seems to be broken on mobile. You can't select anything and trying to paste is just ignored.

      It would be nice if you go go back and view the hint after you've completed a level. Or even if you could try different solutions to a level after you've finished it. You may not always be happy with the first thing that works.

    • AnimatsNov 2016

      W3C: "Service workers create the opportunity for a bad actor to turn a bad day into a bad eternity."[1] With service workers, cross-site scripting vulnerabilities are forever.

      Service workers install by drive-by, which is troubling. In Firefox, check "about:serviceworkers" to see what you have installed. Take a look. You probably have far more service workers active than you thought. There are supposed to be enough cross-site scripting restrictions to keep service workers contained to their origin domain, but some holes have been found. There was a successful service worker attack on Dropbox, since fixed. "If you run a site that serves user files with secret URLs from a shared domain, you need to look out for the Service-Worker: script HTTP header; if you see it, run for the hills."[2]

      If an attacker can get one page loaded from a site being attacked, they then own all traffic between the user and the site. This has lots of attack potential.

      [1] https://www.w3.org/TR/service-workers/#security-considerations
      [2] https://alf.nu/ServiceWorker

    • Minor49erAug 2024

      My first jobs were heavily focused on parsing data from HTML and regex was (and still is) the most common solution for the majority of cases

      To learn it, I played a lot of regex golf [1]

      I also enabled regular expressions in my code editor's Find feature so every search I'd make used regex. Having it enabled in my editor made learning it more immersive and useful, especially when combined with things like find-and-replace. I highly recommend permanently enabling that in your editor as well

      Also, challenge your coworkers to see who can make the shortest patterns for a variety of cases and see whose is the most versatile. It's always a fun time

      [1] https://alf.nu/RegexGolf

    • ThorrezMay 2020

      https://xss-game.appspot.com/ (this has a lot of overlap with gruyere)

      https://github.com/cure53/XSSChallengeWiki/wiki

      https://sites.google.com/site/infosecrocks/ (this links to some of the other stuff I mentioned)

      https://www.hacking-lab.com

      There's also these 2 advanced XSS challenges:

      https://alf.nu/alert1

      https://prompt.ml/0

      I'm not sure if they're still functional, I think some of their solutions require functionality that browsers have since changed.

      You might also want to check out the Youtube channel Live Overflow:

      https://www.youtube.com/channel/UClcE-kVhqyiHCcjYwcpfj9w

    • fanf2Jan 2020

      SHA-1 (and SHA-256 and many other hash functions) are subject to length extension, which is how the 2017 shattered attack works: find a pair of short prefixes that work as PDF headers and that have colliding hashes; then append a common suffix such that the different headers display different parts of the suffixes. Once the collision has been found you can easily make your own colliding PDFs - https://alf.nu/SHA1

      This breaks anything that dedups on just the SHA-1 hashes of raw files

    Related

    Stack Abusestackabuse.com28 people

    A SQLite Tutorial with Node.js

    Stack Abuse
    Company · last shared 2024
    Seth Larsonsethmlarson.dev47 people

    Regex character "$" doesn't mean "end-of-string"

    Seth Larson
    Personal · last shared 2026
    Gustavo Niemeyerlabix.org61 people

    Lunatic Python: Lua Inside Python, and Python Inside Lua

    Gustavo Niemeyer
    Personal · last shared 2022
    Lambda the Ultimatelambda-the-ultimate.org615 people

    Simon Peyton Jones Elected into the Royal Society Fellowship

    Lambda the Ultimate
    Publication · last shared 2026
    Simon Willison's TILstil.simonwillison.net111 people

    One-liner for running queries against CSV files with SQLite

    Simon Willison's TILs
    Personal · last shared 2026
    hur.sthur.st20 people

    Bloom Filter Calculator

    hur.st
    Personal · last shared 2025
    Xe Iasoxeiaso.net198 people

    We all dodged a bullet

    Xe Iaso
    Personal · last shared 2026
    Probably Danceprobablydance.com74 people

    Fibonacci Hashing: The Optimization That the World Forgot

    Probably Dance
    Personal · last shared 2026