<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Encrypt and decrypt personal data with Spark Databricks.We create a table that will include personal information. However, we want to hide personal id... in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23871#M16558</link>
    <description>&lt;P&gt;Hi, yes, in any language supporting AES decryption. Here is an example for Java &lt;A href="https://www.baeldung.com/java-aes-encryption-decryption" target="test_blank"&gt;https://www.baeldung.com/java-aes-encryption-decryption&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 10:22:16 GMT</pubDate>
    <dc:creator>Hubert-Dudek</dc:creator>
    <dc:date>2023-03-06T10:22:16Z</dc:date>
    <item>
      <title>Encrypt and decrypt personal data with Spark Databricks.We create a table that will include personal information. However, we want to hide personal id...</title>
      <link>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23867#M16554</link>
      <description>&lt;P&gt;&lt;B&gt;Encrypt and decrypt personal data with Spark Databricks.&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1967i765C96DB6CFEA60F/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;We create a table that will include personal information. However, we want to hide personal identifiers so no one can see them.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1965i9DB22E47AD33BFF0/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;We set a key. A key need to have 16, 24, or 32 bytes. 1 byte = 1 char.We use a widget for that. It is only for development purposes. In production, we should store that key in Key Vault.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1963i4A91AB5A54AE3176/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;We are inserting data into the table. Phone field we are encrypting using the aes_encrypt function. Since Databricks runtime 10.3, we can use &lt;A href="https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/aes_encrypt.html" alt="https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/aes_encrypt.html" target="_blank"&gt;aes_encrypt&lt;/A&gt; and &lt;A href="https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/aes_decrypt.html" alt="https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/aes_decrypt.html" target="_blank"&gt;aes_decrypt&lt;/A&gt; functions.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1970i0D0C888367D2DAC6/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;Now we can preview the data. Data without encrypting is unreadable.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1971i975195AB86A33EC9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;We need to use the aes_decrypt function with our key when we want to read it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1974iF8D939273D3A8D42/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;B&gt;&lt;span class="lia-unicode-emoji" title=":backhand_index_pointing_right:"&gt;👉&lt;/span&gt; Please watch also my video about &lt;/B&gt;&lt;A href="https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/aes_encrypt.html" alt="https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/aes_encrypt.html" target="_blank"&gt;&lt;B&gt;aes_encrypt&lt;/B&gt;&lt;/A&gt;&lt;B&gt; and &lt;/B&gt;&lt;A href="https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/aes_decrypt.html" alt="https://docs.databricks.com/spark/latest/spark-sql/language-manual/functions/aes_decrypt.html" target="_blank"&gt;&lt;B&gt;aes_decrypt&lt;/B&gt;&lt;/A&gt;&lt;B&gt;:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=OGLf_PiFMks" alt="https://www.youtube.com/watch?v=OGLf_PiFMks" target="_blank"&gt;&lt;span class="lia-unicode-emoji" title=":right_arrow:"&gt;➡️&lt;/span&gt; https://www.youtube.com/watch?v=OGLf_PiFMks&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1968i407FDD02CCA878A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;Link to GitHub with the above notebook: &lt;A href="https://github.com/hubert-dudek/databricks-hubert/blob/main/linkedin/decrypt%20encrypt/decrypt%20encrypt.dbc" alt="https://github.com/hubert-dudek/databricks-hubert/blob/main/linkedin/decrypt%20encrypt/decrypt%20encrypt.dbc" target="_blank"&gt;https://github.com/hubert-dudek/databricks-hubert/blob/main/linkedin/decrypt%20encrypt/decrypt%20encrypt.dbc&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 15:21:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23867#M16554</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-04-03T15:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypt and decrypt personal data with Spark Databricks.We create a table that will include personal information. However, we want to hide personal id...</title>
      <link>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23868#M16555</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp; thank you for sharing this.&lt;/P&gt;&lt;P&gt;Is it possible to get this key from AWS KMS? Also, what are the other ways to efficienlty encrypt and decrypt data using multiple keys and salt - as encrypting using one key could pose a high risk. If it gets leaked then the entire column or db will be exposed.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 01:41:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23868#M16555</guid>
      <dc:creator>AmanSehgal</dc:creator>
      <dc:date>2022-04-04T01:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypt and decrypt personal data with Spark Databricks.We create a table that will include personal information. However, we want to hide personal id...</title>
      <link>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23869#M16556</link>
      <description>&lt;P&gt;Hi @Aman Sehgal​&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Yes, it is possible to get a key from the key vault. I am using Azure key vault for that. However, just code doesn't look as lovely as in the above example as I need to use dbutils secrets and mix python with SQL.&lt;/LI&gt;&lt;LI&gt;Multiple keys and salt - I think you need your own script/implementation for that.&lt;/LI&gt;&lt;LI&gt;The perfect solution would be to encrypt the whole column on the table creation level (like in Synapse dedicated SQL).&lt;/LI&gt;&lt;LI&gt;I know there will be some improvements to handle PID data once the unity catalog is released (lineage, classification). However, I think the whole topic in databricks is relatively young.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 04 Apr 2022 09:18:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23869#M16556</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-04-04T09:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypt and decrypt personal data with Spark Databricks.We create a table that will include personal information. However, we want to hide personal id...</title>
      <link>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23870#M16557</link>
      <description>&lt;P&gt;@Hubert Dudek​&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can we decrypt the data outside of databricks with python? which is encrypted with aes_encrypt&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2023 03:43:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23870#M16557</guid>
      <dc:creator>MaheshDBR</dc:creator>
      <dc:date>2023-03-05T03:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Encrypt and decrypt personal data with Spark Databricks.We create a table that will include personal information. However, we want to hide personal id...</title>
      <link>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23871#M16558</link>
      <description>&lt;P&gt;Hi, yes, in any language supporting AES decryption. Here is an example for Java &lt;A href="https://www.baeldung.com/java-aes-encryption-decryption" target="test_blank"&gt;https://www.baeldung.com/java-aes-encryption-decryption&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 10:22:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/encrypt-and-decrypt-personal-data-with-spark-databricks-we/m-p/23871#M16558</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2023-03-06T10:22:16Z</dc:date>
    </item>
  </channel>
</rss>

