Customer Identifier Obfuscation #
Introduction #
Prisma Campaigns offers a Customer Identifier Obfuscation feature that allows you to enhance the privacy of customer data by hashing their unique identifiers. This feature is particularly valuable when the identifier contains sensitive information like Social Security Numbers or other personal data.
The obfuscation of customer IDs is applied in the following scenarios:
- Customer imports
- Campaign data imports
- Within the funnel, when a data capture field maps to the customer’s identifier
This reference page guides you on how to enable this feature and select a hashing algorithm. It also includes code examples in both JavaScript and Java.
Enabling Customer Identifier Obfuscation #
To enable Customer Identifier Obfuscation, follow these steps:
- Go to Settings in your Prisma Campaigns instance.
- Click on Company Preferences.
- Ensure that there are no existing customers associated with your company. If customers exist, they must be deleted, and you can re-import them later. Otherwise, the Encrypt Customer Identifier option will be disabled.
- Click on Encrypt Customer Identifier.
Generating the Salt Value #
After enabling Customer Identifier Obfuscation and saving your changes, Prisma Campaigns will generate a “salt” value. This value helps enhance the security of the hashed customer identifiers. The salt value must be prepended to the customer ID before applying the selected hashing algorithm.
Supported Hashing Algorithms #
Prisma Campaigns offers three supported hashing algorithms for obfuscating customer identifiers:
- MD5: A widely used cryptographic hash function.
- SHA-256 (default): A strong and widely adopted cryptographic hash function.
- Bcrypt: A secure and adaptive hash function designed for securely hashing passwords.
Code Examples #
Here are some code examples in JavaScript and Java to demonstrate how to obfuscate customer identifiers using the salt and hashing algorithm.
JavaScript:
// Customer ID and salt
const customerId = "12345"; // Replace with your actual customer ID
const salt = "your_salt_value"; // Replace with the generated salt
// Choose a hashing algorithm (e.g., SHA-256)
const crypto = require("crypto");
const hashAlgorithm = "sha256";
// Combine the salt and customer ID, then hash the result
const combinedValue = salt + customerId;
const hashedCustomerId = crypto.createHash(hashAlgorithm).update(combinedValue).digest('hex');
console.log(`Obfuscated Customer ID: ${hashedCustomerId}`);
Java:
import java.security.MessageDigest;
public class CustomerIdObfuscation {
public static void main(String[] args) throws Exception {
// Customer ID and salt
String customerId = "12345"; // Replace with your actual customer ID
String salt = "your_salt_value"; // Replace with the generated salt
// Choose a hashing algorithm (e.g., SHA-256)
String hashAlgorithm = "SHA-256";
// Combine the salt and customer ID, then hash the result
String combinedValue = salt + customerId;
MessageDigest digest = MessageDigest.getInstance(hashAlgorithm);
byte[] hashedBytes = digest.digest(combinedValue.getBytes());
// Convert the hashed bytes to a hexadecimal string
StringBuilder hashedCustomerId = new StringBuilder();
for (byte b : hashedBytes) {
hashedCustomerId.append(String.format("%02x", b));
}
System.out.println("Obfuscated Customer ID: " + hashedCustomerId.toString());
}
}
These code examples demonstrate how to obfuscate a customer’s identifier using the provided salt and your chosen hashing algorithm. You can adapt these code snippets to your workflow to ensure the privacy and security of customer data in Prisma Campaigns.