Skip to content

Use the cryptopan library to pseudonymize IP address before hashing into HLL #273

Closed

Description

@zluudg

To enhance end-user privacy, EDM should encrypt the end-user IP address before hashing into HLL. It should be encrypted with a secret that only the resolver operator knows. The reason for this is that some IP addresses might cause unique patterns in the HLL sketch. Someone with access to a sketch and knowledge of the operator's IP range can generate and use a rainbow table in an attempt to recover some of these addresses from the sketch. Encryption fixes this since it makes the rainbow table impossible to generate.

Getting familiarized with the code around here should be a good implementation starting point:

dangerRealClientIP := append(dangerScratch[:0], dt.Message.QueryAddress...)

Activity

  1. zluudg commented on Aug 17, 2026

    @zluudg
    MemberAuthor

    Techdocs should be updated once this feature is properly in place. A PR has been prepared here: https://github.com/dnstapir/techdocs/pull/65

  2. morkrost commented on Aug 17, 2026

    @morkrost

    Actually...

    We really don't need something as advanced as CryptoPAn, since we don't care about subnets. I would suggest that we remove the CryptoPAn dependency entirely and use 64 bits from a (pick one) cryptographic hash F( key + IPv4 address) instead of Murmur3. Key is equivalent to the key used for CryptoPAn.

    Oh, and the same for IPv6, naturally.

  3. zluudg commented on Sep 17, 2026

    @zluudg
    MemberAuthor

    Succeeded by #302, will not use cryptopan but AES instead.

  4. linked a pull request that will close this issueIP addresses and identities #319on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions