Search code examples
hana

Hashing/Encryption in HANA graphical calculation view


We have SAP HANA database in our data warehouse system. In one of our graphical calculation view we want to have 3 columns encrypted. Is it possible to create calculated column for the same? If yes, using which function? Previously in Oracle we used to achieve this using ORA_HASH function. We need encryption in such a way that if value of column is repeated then encrypted value should also be same?

Best Regards


Solution

  • You could create a SQL view on top of the calculation view that uses the HASH_SHA256() function to encrypt the data.

    SELECT 
         plain_view_field
       , HASH_SHA256( to_binary (plain_view_field)) as encrypted
    FROM "_SYS_BIC"."package_name/view_name";