IP Hashing Rules for Exposure Data

Edited

If you prefer not to send plaintext IP addresses, you can hash them before delivery. This article covers the algorithm, input formatting, and output requirements MX8 expects when you send hashed IPs.

Algorithm

MX8 currently uses MD5 as the default hashing algorithm. If you need a different algorithm, contact your MX8 account team — other options are available on request.

Input formatting

How you format the IP address before hashing matters. MX8 needs to replicate your process exactly in order to produce matching hashes, so follow these rules precisely.

IPv4: Use the full dotted-decimal string with no modifications. For example, 203.0.113.7 — not zero-padded, not stripped of leading segments.

IPv6: Truncate to the /64 prefix by zeroing the last 64 bits, then use the canonical short form defined in RFC 5952. For example, 2001:db8:85a3:: (not the full expanded form).

Salt

No salt is preferred. If you do use a static salt, share it with MX8 securely during onboarding. The salt value is configured in the Hash Salt field when you create your S3 snapshot source — see Creating an S3 Snapshot Exposure Source for details.

Output format

MX8 accepts hashed IPs in two formats:

  • Lowercase hex (preferred) — e.g., 540be8dfb8d691b39c05e32c3261ba8b

  • Base64 — if hex isn't convenient for your pipeline

Make sure the output format is consistent across all rows in your files.

Provide a code snippet

When onboarding, please share a short code snippet (in any language) that shows exactly how you generate the hash. This lets MX8 verify that both sides produce identical output for the same input. A Python example might look like:

import hashlib

def hash_ip(ip_address: str) -> str:
    return hashlib.md5(ip_address.encode("utf-8")).hexdigest()

If you use a salt, include that in the snippet as well so the full process is documented.

How this connects to source configuration

When you create an S3 snapshot source, two fields relate directly to hashing:

  • Hash Salt — enter the salt value here (or leave empty if you don't salt).

  • Hashed IP Field Mapping — the column name in your CSV that contains the hashed IP values.

See Creating an S3 Snapshot Exposure Source for the full setup walkthrough.

Was this article helpful?

Sorry about that! Care to tell us more?

Thanks for the feedback!

There was an issue submitting your feedback
Please check your connection and try again.