【问题标题】:undestand Snowflake encryption results了解雪花加密结果
【发布时间】:2021-10-25 12:28:30
【问题描述】:

当我在 Snowflake 上运行这个命令时,例如:

select encrypt_raw(to_binary(hex_encode('239.239.239.239')), 
                                   to_binary(hex_encode('1234567890123456')), 
                                   to_binary(hex_encode('123456789012'))
              )

我得到这个结果:

{ "ciphertext": "83425786EAA26D2695C2229B640263", "iv": "313233343536373839303132", "tag": "F377ACE5BFA744D22599F9A1F274B840" }

这个结果中的加密值本身是什么?

【问题讨论】:

    标签: snowflake-cloud-data-platform


    【解决方案1】:

    根据我们的文档:

    https://docs.snowflake.com/en/sql-reference/functions/encrypt_raw.html#returns

    The second field is the ciphertext (encrypted value) of the value_to_encrypt.
    

    【讨论】:

    • 如何从结果中获取这个特定字段?我需要将它插入到表格中。
    【解决方案2】:

    第二个问题:

    select V:ciphertext from (select encrypt_raw(to_binary(hex_encode('239.239.239.239')), 
                                       to_binary(hex_encode('1234567890123456')), 
                                       to_binary(hex_encode('123456789012'))
                  ) as v);
    

    让我得到这个输出:

    【讨论】:

      猜你喜欢
      • 2020-11-29
      • 2021-10-16
      • 1970-01-01
      • 2020-08-14
      • 2021-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多