MadhuB
Valued Contributor

Hi @weilin0323 

Have you tried the built-in function? Refer to below encryption code snippet.

create table if not exists catalog.schema.testencryption(
  id int,
  name string,
  tss string
);

insert into catalog.schema.testencryption
values (1,'sam','123-123-123'),
(2,'john','456-456-456'),
(3,'pat','789-789-789');

SELECT
  id,
  name,
  base64(aes_encrypt(tss, 'sample_key_16by.', 'GCM')) AS encrypted_tss
FROM
  catalog.schema.testencryption;

without encryption:

MadhuB_1-1737568383906.png

with encryption:

MadhuB_0-1737568365714.png

Please let me know if there is anything else. Otherwise, please mark it as a solution.

View solution in original post