Hash SHA-512 with key

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.

1
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.

2
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.

3
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.

4
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.

5
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.

Frequently asked questions

What is the purpose of the SHA-512 with Key function?
The SHA-512 with Key function is used for pseudonymization, allowing you to protect sensitive data by creating a deterministic hash that cannot be reversed without knowing the original key and value.
Which field types can I apply this hash function to?
The function supports text, timestamp, date, float, int, boolean, and time fields. All of these will be converted to text output containing the SHA-512 hexadecimal digest.
Why is a key concatenated with the field value before hashing?
Concatenating a key with the field value adds a secret salt, making it significantly harder to reverse the hash through brute-force or rainbow table attacks, even if the original data values are predictable.
What happens if the input field value is null or empty?
According to the pseudo-code implementation, if the input value is null or evaluates to false, the function returns None rather than attempting to hash an empty value.
Is the SHA-512 with Key function suitable for GDPR compliance?
Pseudonymization via keyed hashing can support GDPR compliance efforts by reducing data identifiability, though you should consult your legal team and review Kondado's security practices as part of a comprehensive compliance strategy.

Written by·Published 2024-12-20·Updated 2026-04-25