Deterministic encryption algorithm for encrypting a data column

pmscorca 1,032 Reputation points
2024-03-03T17:51:27.79+00:00

Hi,

I need to encrypt only a table column of data possibly with a deterministic algorithm and a fixed key. I've tried to use the simple simmetric encryption, but for each execution changing the related encrypted column.

Any suggests to me, please? Thanks

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,235 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VasimTamboli 5,120 Reputation points
    2024-03-03T19:36:21.84+00:00

    2 Option i can suggest here

    Option 1 - Deterministic Encryption Functions: Synapse Analytics has built-in functions like DETERMINISTIC_ENCRYPT and DETERMINISTIC_DECRYPT. These functions use a special algorithm that always gives the same encrypted result for the same data and key.

    SQL Script - SELECT DETERMINISTIC_ENCRYPT('Secret data', 'your_fixed_key') AS encrypted_data

    FROM your_table;

    Option 2 - Combining Symmetric Encryption with Hashing: While not directly supported in Synapse Analytics, you can still achieve deterministic encryption. Here's how:

    Hash the data: Use a hashing function like SHA256 on your data to get a fixed-length string.

    Combine hash and data: Mix the obtained hash with your original data.

    Encrypt the combined string: Use a symmetric encryption method with your fixed key to encrypt the mix of hash and data.

    Please let me know if u have any concerns. please accept as answer if it helped you.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.