Hash SHA-512 with Key
Description
Applies a SHA-512 hash to the field concatenated with a key.
Category
Pseudonymization
Supported Field Types
- text
- timestamp
- date
- float
- int
- boolean
- time
Output Field Type
- text
Arguments
- Key: The key that will be concatenated with the original field value before applying the hash.
Pseudo-code (Python)
def func(val, key):
"""
val: field value
key: key text
"""
import hashlib
if val:
sha = hashlib.sha512()
data = "%s%s" % (key, val)
sha.update(data.encode('utf-8'))
return sha.hexdigest()
else:
return None
Apply SHA-512 Hash with Key in Kondado
Use the SHA-512 with Key function to pseudonymize sensitive data in your pipelines by hashing field values concatenated with a secret key.
Identify fields needing pseudonymization
Review your data sources and identify which fields contain sensitive information that should be pseudonymized before loading to destinations like data warehouses or BI tools.
Configure the SHA-512 with Key function
In your data transformation pipeline, select the 'Hash SHA-512 with Key' function and specify the secret key that will be concatenated with the original field value before hashing.
Verify supported field types
Ensure your source field is one of the supported types: text, timestamp, date, float, int, boolean, or time. The function will output a text field containing the hexadecimal hash digest.
Test and validate hash output
Run a test transformation to verify the hash output is deterministic (same input + key always produces same output) and that null values return None as expected.
Deploy to production pipeline
Apply the configured transformation to your production pipeline, ensuring the key is securely stored and consistent across runs to maintain data integrity for analytics purposes.