Skip to content

Commit

Permalink
doc update and slight change to key api.
Browse files Browse the repository at this point in the history
  • Loading branch information
michelp committed Sep 5, 2022
1 parent 52fcc04 commit 6946007
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 62 deletions.
31 changes: 19 additions & 12 deletions docs/Server_Key_Management.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "5cf3ddbe-149e-4e5e-ac79-52092770b5e5",
"metadata": {},
"outputs": [],
Expand All @@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"id": "c516e4bc-4622-43ef-8183-9b9607b69bd0",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -70,15 +70,15 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 3,
"id": "df926fda-416e-43bd-8df1-cf0fc3864642",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"b'.0\\xb9l\\xe2\\x83ND\\x83\\xdf\\xa2\\x83\\xff\\x8f?\\xaf\\xde\\xf5\\xfb\\xf9\\x9c\\xde)\\x99\\xec\\xd6\\xe2\\xdc\\x18\\xdf\\xab\\xec'\n"
"b'\\x1d\\xa5\\xf2\\xa0a\\xa8\\x03 \\x9b\\x88J\\xfe\\xd2Xc\\x0cG\\xc5{\\xc3W\\xd7\\x91KXp\\x87\\x15\\x02\"\\xd6\\xf6'\n"
]
}
],
Expand All @@ -90,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 4,
"id": "45eb7a0f-b260-4fd9-929f-1a2b9d6bc29c",
"metadata": {},
"outputs": [
Expand All @@ -110,23 +110,23 @@
" <th>associated_data</th>\n",
" </tr>\n",
" <tr>\n",
" <td>9fac7ff7-10d7-4139-966b-f7317e4486b2</td>\n",
" <td>92e24493-2df6-422b-8c75-00c82b1097c4</td>\n",
" <td>None</td>\n",
" <td>valid</td>\n",
" <td>hmacsha256</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" <td>2022-09-04 21:40:19.783942+00:00</td>\n",
" <td>2022-09-05 19:46:07.340760+00:00</td>\n",
" <td>None</td>\n",
" <td></td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(UUID('9fac7ff7-10d7-4139-966b-f7317e4486b2'), None, 'valid', 'hmacsha256', None, None, datetime.datetime(2022, 9, 4, 21, 40, 19, 783942, tzinfo=datetime.timezone.utc), None, '')]"
"[(UUID('92e24493-2df6-422b-8c75-00c82b1097c4'), None, 'valid', 'hmacsha256', None, None, datetime.datetime(2022, 9, 5, 19, 46, 7, 340760, tzinfo=datetime.timezone.utc), None, '')]"
]
},
"execution_count": 21,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -137,7 +137,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 5,
"id": "aa4e304f-69cc-42f8-9335-9d022fc90b17",
"metadata": {},
"outputs": [
Expand All @@ -163,14 +163,21 @@
" <td>a1f91b67-2793-4788-ab8e-4fca32e360da</td>\n",
" <td>32</td>\n",
" </tr>\n",
" <tr>\n",
" <td>92e24493-2df6-422b-8c75-00c82b1097c4</td>\n",
" <td>hmacsha256</td>\n",
" <td>cc815230-06c6-4d57-9780-ac2a2dc026bc</td>\n",
" <td>32</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[(UUID('5a8720af-50aa-4bd9-a9f1-c71065e75a88'), 'hmacsha256', UUID('451843b3-74f8-4458-bc2d-5a88c6024832'), 32),\n",
" (UUID('9fac7ff7-10d7-4139-966b-f7317e4486b2'), 'hmacsha256', UUID('a1f91b67-2793-4788-ab8e-4fca32e360da'), 32)]"
" (UUID('9fac7ff7-10d7-4139-966b-f7317e4486b2'), 'hmacsha256', UUID('a1f91b67-2793-4788-ab8e-4fca32e360da'), 32),\n",
" (UUID('92e24493-2df6-422b-8c75-00c82b1097c4'), 'hmacsha256', UUID('cc815230-06c6-4d57-9780-ac2a2dc026bc'), 32)]"
]
},
"execution_count": 36,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
12 changes: 9 additions & 3 deletions docs/Server_Key_Management.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ external_key = bytes(external_key[0][0])
print(external_key)
```

b'.0\xb9l\xe2\x83ND\x83\xdf\xa2\x83\xff\x8f?\xaf\xde\xf5\xfb\xf9\x9c\xde)\x99\xec\xd6\xe2\xdc\x18\xdf\xab\xec'
b'\x1d\xa5\xf2\xa0a\xa8\x03 \x9b\x88J\xfe\xd2Xc\x0cG\xc5{\xc3W\xd7\x91KXp\x87\x15\x02"\xd6\xf6'



Expand All @@ -75,13 +75,13 @@ print(external_key)
<th>associated_data</th>
</tr>
<tr>
<td>9fac7ff7-10d7-4139-966b-f7317e4486b2</td>
<td>92e24493-2df6-422b-8c75-00c82b1097c4</td>
<td>None</td>
<td>valid</td>
<td>hmacsha256</td>
<td>None</td>
<td>None</td>
<td>2022-09-04 21:40:19.783942+00:00</td>
<td>2022-09-05 19:46:07.340760+00:00</td>
<td>None</td>
<td></td>
</tr>
Expand Down Expand Up @@ -116,6 +116,12 @@ print(external_key)
<td>a1f91b67-2793-4788-ab8e-4fca32e360da</td>
<td>32</td>
</tr>
<tr>
<td>92e24493-2df6-422b-8c75-00c82b1097c4</td>
<td>hmacsha256</td>
<td>cc815230-06c6-4d57-9780-ac2a2dc026bc</td>
<td>32</td>
</tr>
</table>


60 changes: 30 additions & 30 deletions docs/Transparent_Column_Encryption.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"The security label will be: ENCRYPT WITH KEY ID 7dff7a77-1b3a-47e4-97d1-43d0c5c971d4\n"
"The security label will be: ENCRYPT WITH KEY ID 3b72130d-32c1-42a2-8ed4-c35086ca60e8\n"
]
}
],
Expand Down Expand Up @@ -220,15 +220,15 @@
" <tr>\n",
" <td>my_secrets</td>\n",
" <td>pgsodium</td>\n",
" <td>ENCRYPT WITH KEY ID 7dff7a77-1b3a-47e4-97d1-43d0c5c971d4</td>\n",
" <td>ENCRYPT WITH KEY ID 3b72130d-32c1-42a2-8ed4-c35086ca60e8</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[('pgsodium.key', 'pgsodium', 'ENCRYPT WITH KEY COLUMN parent_key ASSOCIATED (id, associated_data) NONCE raw_key_nonce'),\n",
" ('my_customer_secrets', 'pgsodium', 'DECRYPT WITH VIEW public.other_name_view'),\n",
" ('my_customer_secrets', 'pgsodium', 'ENCRYPT WITH KEY COLUMN key_id ASSOCIATED (id, associated_data, owner) NONCE nonce'),\n",
" ('my_secrets', 'pgsodium', 'ENCRYPT WITH KEY ID 7dff7a77-1b3a-47e4-97d1-43d0c5c971d4')]"
" ('my_secrets', 'pgsodium', 'ENCRYPT WITH KEY ID 3b72130d-32c1-42a2-8ed4-c35086ca60e8')]"
]
},
"execution_count": 7,
Expand Down Expand Up @@ -299,20 +299,20 @@
" <th>secret</th>\n",
" </tr>\n",
" <tr>\n",
" <td>UPLO9S0j5JNynLxsXusXka5lIAGNYlRVqWWu4l8OcqbqrEitWXvp</td>\n",
" <td>ZpIusOfIP76sHzOTTWhPn6S0GNz14K2bmZFR2KRzHrYTRLCW8NO8</td>\n",
" </tr>\n",
" <tr>\n",
" <td>XJi1+Q8V/BH1awvprPKu7JKC9ImCrk+E5/Ro/3DIIkjyFsUhBWc=</td>\n",
" <td>V96NMLHu6nhnJHw1AXA/+zsDpk8Hq7NY7DbbtBQjqG9TQ6t9dF4=</td>\n",
" </tr>\n",
" <tr>\n",
" <td>28fPDid2nuAYkCh49ZvrI8pXQHMF98FAKjscsYiq67hlWxsAGFiSjf9/PRAhEz1oxdhvQqOIN9qR<br>PUMetCs=</td>\n",
" <td>9z2kXtIYOgSNl/fcZEXqz44baRpVyFhV/jH/yp/jP/FbpR1Qle0oDIZrMF0iCyomTtGsKEKPioWZ<br>wf64xVs=</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[('UPLO9S0j5JNynLxsXusXka5lIAGNYlRVqWWu4l8OcqbqrEitWXvp',),\n",
" ('XJi1+Q8V/BH1awvprPKu7JKC9ImCrk+E5/Ro/3DIIkjyFsUhBWc=',),\n",
" ('28fPDid2nuAYkCh49ZvrI8pXQHMF98FAKjscsYiq67hlWxsAGFiSjf9/PRAhEz1oxdhvQqOIN9qR\\nPUMetCs=',)]"
"[('ZpIusOfIP76sHzOTTWhPn6S0GNz14K2bmZFR2KRzHrYTRLCW8NO8',),\n",
" ('V96NMLHu6nhnJHw1AXA/+zsDpk8Hq7NY7DbbtBQjqG9TQ6t9dF4=',),\n",
" ('9z2kXtIYOgSNl/fcZEXqz44baRpVyFhV/jH/yp/jP/FbpR1Qle0oDIZrMF0iCyomTtGsKEKPioWZ\\nwf64xVs=',)]"
]
},
"execution_count": 9,
Expand Down Expand Up @@ -350,23 +350,23 @@
" <th>decrypted_secret</th>\n",
" </tr>\n",
" <tr>\n",
" <td>UPLO9S0j5JNynLxsXusXka5lIAGNYlRVqWWu4l8OcqbqrEitWXvp</td>\n",
" <td>ZpIusOfIP76sHzOTTWhPn6S0GNz14K2bmZFR2KRzHrYTRLCW8NO8</td>\n",
" <td>sekert1</td>\n",
" </tr>\n",
" <tr>\n",
" <td>XJi1+Q8V/BH1awvprPKu7JKC9ImCrk+E5/Ro/3DIIkjyFsUhBWc=</td>\n",
" <td>V96NMLHu6nhnJHw1AXA/+zsDpk8Hq7NY7DbbtBQjqG9TQ6t9dF4=</td>\n",
" <td>shhhhh</td>\n",
" </tr>\n",
" <tr>\n",
" <td>28fPDid2nuAYkCh49ZvrI8pXQHMF98FAKjscsYiq67hlWxsAGFiSjf9/PRAhEz1oxdhvQqOIN9qR<br>PUMetCs=</td>\n",
" <td>9z2kXtIYOgSNl/fcZEXqz44baRpVyFhV/jH/yp/jP/FbpR1Qle0oDIZrMF0iCyomTtGsKEKPioWZ<br>wf64xVs=</td>\n",
" <td>0xABC_my_payment_processor_key</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[('UPLO9S0j5JNynLxsXusXka5lIAGNYlRVqWWu4l8OcqbqrEitWXvp', 'sekert1'),\n",
" ('XJi1+Q8V/BH1awvprPKu7JKC9ImCrk+E5/Ro/3DIIkjyFsUhBWc=', 'shhhhh'),\n",
" ('28fPDid2nuAYkCh49ZvrI8pXQHMF98FAKjscsYiq67hlWxsAGFiSjf9/PRAhEz1oxdhvQqOIN9qR\\nPUMetCs=', '0xABC_my_payment_processor_key')]"
"[('ZpIusOfIP76sHzOTTWhPn6S0GNz14K2bmZFR2KRzHrYTRLCW8NO8', 'sekert1'),\n",
" ('V96NMLHu6nhnJHw1AXA/+zsDpk8Hq7NY7DbbtBQjqG9TQ6t9dF4=', 'shhhhh'),\n",
" ('9z2kXtIYOgSNl/fcZEXqz44baRpVyFhV/jH/yp/jP/FbpR1Qle0oDIZrMF0iCyomTtGsKEKPioWZ\\nwf64xVs=', '0xABC_my_payment_processor_key')]"
]
},
"execution_count": 10,
Expand Down Expand Up @@ -537,29 +537,29 @@
" <th>key_id</th>\n",
" </tr>\n",
" <tr>\n",
" <td>nUxRwiQhhxFZlBxTkldF8ff3N3XnPrTIZWMqyZ+aliwGygGp</td>\n",
" <td>GrDDDYZXzBvAjKWWeVrCBtt8ngVM3t+k4JFd37ll0EtGtREB</td>\n",
" <td>{&#x27;type&#x27;: &#x27;color&#x27;}</td>\n",
" <td>bob</td>\n",
" <td>a42a4267-0fb1-4d83-8982-e33814010bae</td>\n",
" <td>bb04c8f9-c9ff-4978-a39d-afe44ca98e9a</td>\n",
" </tr>\n",
" <tr>\n",
" <td>0Agh3PJefpohSVYtMDxWdzCl765erewje0a40L50hw7SDm2Y</td>\n",
" <td>N7427oX6/ENTnuYuk4FfGdo1tldjiZI/wF4Hk9nT97Um+xSm</td>\n",
" <td>{&#x27;type&#x27;: &#x27;food&#x27;}</td>\n",
" <td>alice</td>\n",
" <td>6f4e4275-64e9-4de9-a3ae-f263a07645a8</td>\n",
" <td>fa0050ed-2876-4f98-b677-0000cf5fffb4</td>\n",
" </tr>\n",
" <tr>\n",
" <td>4yNi9vag6yOttKIR7ZETJjrtin+WRRdKHKZGqH9xavBzV6Cp</td>\n",
" <td>AV2GSzBDgAO71TqCXUKJD4U3Bd7H55rfH3grNEElO6w3uajE</td>\n",
" <td>{&#x27;type&#x27;: &#x27;car&#x27;}</td>\n",
" <td>mallory</td>\n",
" <td>2df9c696-3e31-4517-b12e-1c0b629db0f9</td>\n",
" <td>eb9291a2-2cf2-4ce3-8e99-e002b47b9d57</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[('nUxRwiQhhxFZlBxTkldF8ff3N3XnPrTIZWMqyZ+aliwGygGp', {'type': 'color'}, 'bob', UUID('a42a4267-0fb1-4d83-8982-e33814010bae')),\n",
" ('0Agh3PJefpohSVYtMDxWdzCl765erewje0a40L50hw7SDm2Y', {'type': 'food'}, 'alice', UUID('6f4e4275-64e9-4de9-a3ae-f263a07645a8')),\n",
" ('4yNi9vag6yOttKIR7ZETJjrtin+WRRdKHKZGqH9xavBzV6Cp', {'type': 'car'}, 'mallory', UUID('2df9c696-3e31-4517-b12e-1c0b629db0f9'))]"
"[('GrDDDYZXzBvAjKWWeVrCBtt8ngVM3t+k4JFd37ll0EtGtREB', {'type': 'color'}, 'bob', UUID('bb04c8f9-c9ff-4978-a39d-afe44ca98e9a')),\n",
" ('N7427oX6/ENTnuYuk4FfGdo1tldjiZI/wF4Hk9nT97Um+xSm', {'type': 'food'}, 'alice', UUID('fa0050ed-2876-4f98-b677-0000cf5fffb4')),\n",
" ('AV2GSzBDgAO71TqCXUKJD4U3Bd7H55rfH3grNEElO6w3uajE', {'type': 'car'}, 'mallory', UUID('eb9291a2-2cf2-4ce3-8e99-e002b47b9d57'))]"
]
},
"execution_count": 15,
Expand Down Expand Up @@ -600,26 +600,26 @@
" <td>blue</td>\n",
" <td>{&#x27;type&#x27;: &#x27;color&#x27;}</td>\n",
" <td>bob</td>\n",
" <td>a42a4267-0fb1-4d83-8982-e33814010bae</td>\n",
" <td>bb04c8f9-c9ff-4978-a39d-afe44ca98e9a</td>\n",
" </tr>\n",
" <tr>\n",
" <td>nuts</td>\n",
" <td>{&#x27;type&#x27;: &#x27;food&#x27;}</td>\n",
" <td>alice</td>\n",
" <td>6f4e4275-64e9-4de9-a3ae-f263a07645a8</td>\n",
" <td>fa0050ed-2876-4f98-b677-0000cf5fffb4</td>\n",
" </tr>\n",
" <tr>\n",
" <td>fast</td>\n",
" <td>{&#x27;type&#x27;: &#x27;car&#x27;}</td>\n",
" <td>mallory</td>\n",
" <td>2df9c696-3e31-4517-b12e-1c0b629db0f9</td>\n",
" <td>eb9291a2-2cf2-4ce3-8e99-e002b47b9d57</td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"[('blue', {'type': 'color'}, 'bob', UUID('a42a4267-0fb1-4d83-8982-e33814010bae')),\n",
" ('nuts', {'type': 'food'}, 'alice', UUID('6f4e4275-64e9-4de9-a3ae-f263a07645a8')),\n",
" ('fast', {'type': 'car'}, 'mallory', UUID('2df9c696-3e31-4517-b12e-1c0b629db0f9'))]"
"[('blue', {'type': 'color'}, 'bob', UUID('bb04c8f9-c9ff-4978-a39d-afe44ca98e9a')),\n",
" ('nuts', {'type': 'food'}, 'alice', UUID('fa0050ed-2876-4f98-b677-0000cf5fffb4')),\n",
" ('fast', {'type': 'car'}, 'mallory', UUID('eb9291a2-2cf2-4ce3-8e99-e002b47b9d57'))]"
]
},
"execution_count": 16,
Expand Down
Loading

0 comments on commit 6946007

Please sign in to comment.