update documentation

This commit is contained in:
2025-03-24 15:34:34 -05:00
parent 3a9fadfc03
commit 851c547add
2 changed files with 274 additions and 143 deletions

View File

@@ -29,18 +29,21 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2025-03-24T20:06:28.904351Z",
"start_time": "2025-03-24T20:06:28.864248Z"
"end_time": "2025-03-24T20:25:08.637548Z",
"start_time": "2025-03-24T20:25:08.607886Z"
}
},
"outputs": [],
"execution_count": 4
"execution_count": 1
},
{
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T20:25:08.642553Z",
"start_time": "2025-03-24T20:25:08.640602Z"
}
},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"api = NKodeAPI()\n",
"user_icons = np.array([\n",
@@ -51,7 +54,9 @@
" \"🦁\", \"🐻\", \"🐸\", \"🐙\", \"🦄\",\n",
" \"🌟\", \"⚡\", \"🔥\", \"🍕\", \"🎉\"\n",
"])"
]
],
"outputs": [],
"execution_count": 2
},
{
"metadata": {},
@@ -76,10 +81,13 @@
]
},
{
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T20:25:08.679087Z",
"start_time": "2025-03-24T20:25:08.667792Z"
}
},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"policy = NKodePolicy(\n",
" max_nkode_len=10,\n",
@@ -102,20 +110,62 @@
"print(f\"Position to Properties Map:\")\n",
"for pos_val, props in position_properties_dict.items():\n",
" print(f\"{pos_val}: {props}\")"
]
],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Customer Position Key: [36587 51243 16045 24580 51231 48943]\n",
"Customer Properties Key:\n",
"[23910 10306 19502 5449 54702 12273]\n",
"[53013 18581 4421 45433 39661 27006]\n",
"[16680 54596 31667 35220 1865 8499]\n",
"[37220 26796 20234 3387 44239 47346]\n",
"[55497 7967 5622 1002 13135 4901]\n",
"Position to Properties Map:\n",
"36587: [23910 53013 16680 37220 55497]\n",
"51243: [10306 18581 54596 26796 7967]\n",
"16045: [19502 4421 31667 20234 5622]\n",
"24580: [ 5449 45433 35220 3387 1002]\n",
"51231: [54702 39661 1865 44239 13135]\n",
"48943: [12273 27006 8499 47346 4901]\n"
]
}
],
"execution_count": 3
},
{
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T20:25:08.687137Z",
"start_time": "2025-03-24T20:25:08.684437Z"
}
},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"user_icon_keypad = user_icons.reshape(-1, keypad_size.props_per_key)\n",
"pos_icons_dict = dict(zip(customer.cipher.position_key, user_icon_keypad.T))\n",
"print(\"Position Value to Icons Map:\")\n",
"for pos_val, icons in pos_icons_dict.items():\n",
" print(f\"{pos_val}: {icons}\")\n"
]
],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Position Value to Icons Map:\n",
"36587: ['😀' '🥺' '🤔' '🐱' '🦄']\n",
"51243: ['😂' '😡' '🙃' '🐶' '🌟']\n",
"16045: ['🥳' '😱' '😇' '🦁' '⚡']\n",
"24580: ['😍' '🤯' '🤖' '🐻' '🔥']\n",
"51231: ['🤓' '🥰' '👽' '🐸' '🍕']\n",
"48943: ['😎' '😴' '👾' '🐙' '🎉']\n"
]
}
],
"execution_count": 4
},
{
"metadata": {},
@@ -137,10 +187,13 @@
]
},
{
"metadata": {},
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T20:25:08.705881Z",
"start_time": "2025-03-24T20:25:08.699280Z"
}
},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"username = random_username()\n",
"signup_session_id, set_signup_keypad = api.generate_signup_keypad(customer_id, username)\n",
@@ -150,7 +203,73 @@
"keypad_view(set_signup_keypad, keypad_size.numb_of_keys)\n",
"display(Markdown(\"\"\"### Customer Properties Keypad\"\"\"))\n",
"keypad_view(customer.cipher.property_key[set_signup_keypad], keypad_size.numb_of_keys)"
]
],
"outputs": [
{
"data": {
"text/plain": [
"<IPython.core.display.Markdown object>"
],
"text/markdown": "### Icon Keypad"
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Key 0: ['🥺' '😂' '😱' '🔥' '👽']\n",
"Key 1: ['🐱' '🙃' '😇' '🐻' '🐸']\n",
"Key 2: ['😀' '🌟' '🥳' '🤖' '🤓']\n",
"Key 3: ['🦄' '🐶' '🦁' '🤯' '🥰']\n",
"Key 4: ['🤔' '😡' '⚡' '😍' '🍕']\n"
]
},
{
"data": {
"text/plain": [
"<IPython.core.display.Markdown object>"
],
"text/markdown": "### Index Keypad"
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Key 0: [ 6 1 8 27 16]\n",
"Key 1: [18 13 14 21 22]\n",
"Key 2: [ 0 25 2 15 4]\n",
"Key 3: [24 19 20 9 10]\n",
"Key 4: [12 7 26 3 28]\n"
]
},
{
"data": {
"text/plain": [
"<IPython.core.display.Markdown object>"
],
"text/markdown": "### Customer Properties Keypad"
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Key 0: [53013 10306 4421 1002 1865]\n",
"Key 1: [37220 54596 31667 3387 44239]\n",
"Key 2: [23910 7967 19502 35220 54702]\n",
"Key 3: [55497 26796 20234 45433 39661]\n",
"Key 4: [16680 18581 5622 5449 13135]\n"
]
}
],
"execution_count": 5
},
{
"metadata": {},
@@ -163,24 +282,11 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:10.726327Z",
"start_time": "2025-03-24T09:48:10.723046Z"
"end_time": "2025-03-24T20:25:08.729881Z",
"start_time": "2025-03-24T20:25:08.726837Z"
}
},
"cell_type": "code",
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"User Passcode Indices: [8, 15, 17, 7]\n",
"User Passcode Icons: ['😱' '🤖' '👾' '😡']\n",
"User Passcode Server-side properties: [59668 24111 25394 7431]\n",
"Selected Keys: [3, 1, 4, 3]\n"
]
}
],
"execution_count": 6,
"source": [
"passcode_len = 4\n",
"passcode_property_indices = np.random.choice(set_signup_keypad.reshape(-1), size=passcode_len, replace=False).tolist()\n",
@@ -189,7 +295,20 @@
"print(f\"User Passcode Icons: {user_icons[passcode_property_indices]}\")\n",
"print(f\"User Passcode Server-side properties: {customer.cipher.property_key[passcode_property_indices]}\")\n",
"print(f\"Selected Keys: {selected_keys_set}\")"
]
],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"User Passcode Indices: [22, 8, 14, 12]\n",
"User Passcode Icons: ['🐸' '😱' '😇' '🤔']\n",
"User Passcode Server-side properties: [44239 4421 31667 16680]\n",
"Selected Keys: [1, 0, 1, 4]\n"
]
}
],
"execution_count": 6
},
{
"metadata": {},
@@ -202,8 +321,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.002815Z",
"start_time": "2025-03-24T09:48:10.759840Z"
"end_time": "2025-03-24T20:25:09.048762Z",
"start_time": "2025-03-24T20:25:08.811165Z"
}
},
"cell_type": "code",
@@ -220,13 +339,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Key 0: [ 1 26 9 4 11]\n",
"Key 1: [19 8 3 28 17]\n",
"Key 2: [ 7 20 21 10 23]\n",
"Key 3: [13 14 15 16 5]\n",
"Key 4: [25 2 27 22 29]\n",
"Key 0: [24 25 26 27 22]\n",
"Key 1: [18 19 2 3 16]\n",
"Key 2: [ 6 13 20 15 28]\n",
"Key 3: [12 1 14 9 4]\n",
"Key 4: [ 0 7 8 21 10]\n",
"Selected Keys\n",
"[1, 3, 1, 2]\n"
"[0, 4, 3, 3]\n"
]
}
],
@@ -240,8 +359,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.011978Z",
"start_time": "2025-03-24T09:48:11.009413Z"
"end_time": "2025-03-24T20:25:09.058216Z",
"start_time": "2025-03-24T20:25:09.055315Z"
}
},
"cell_type": "code",
@@ -260,18 +379,18 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Set Key 0: ['😡' '😱' '🔥' '👽' '😴']\n",
"Confirm Key 0: ['🐶' '😱' '😍' '🍕' '👾']\n",
"Set Key 0: ['🐱' '🙃' '😇' '🐻' '🐸']\n",
"Confirm Key 0: ['🦄' '🌟' '' '🔥' '🐸']\n",
"Overlapping icon 🐸\n",
"Set Key 1: ['🥺' '😂' '😱' '🔥' '👽']\n",
"Confirm Key 1: ['😀' '😡' '😱' '🐻' '🥰']\n",
"Overlapping icon 😱\n",
"Set Key 1: ['🐶' '' '🤖' '🥰' '🎉']\n",
"Confirm Key 1: ['🙃' '😇' '🤖' '👽' '😎']\n",
"Overlapping icon 🤖\n",
"Set Key 2: ['🙃' '🦁' '🤯' '🐸' '👾']\n",
"Confirm Key 2: ['🐶' '😱' '😍' '🍕' '👾']\n",
"Overlapping icon 👾\n",
"Set Key 3: ['😡' '😱' '🔥' '👽' '😴']\n",
"Confirm Key 3: ['😡' '🦁' '🐻' '🥰' '🐙']\n",
"Overlapping icon 😡\n"
"Set Key 2: ['🐱' '🙃' '😇' '🐻' '🐸']\n",
"Confirm Key 2: ['🤔' '😂' '😇' '🤯' '🤓']\n",
"Overlapping icon 😇\n",
"Set Key 3: ['🤔' '😡' '' '😍' '🍕']\n",
"Confirm Key 3: ['🤔' '😂' '😇' '🤯' '🤓']\n",
"Overlapping icon 🤔\n"
]
}
],
@@ -295,8 +414,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.030598Z",
"start_time": "2025-03-24T09:48:11.025452Z"
"end_time": "2025-03-24T20:25:09.069308Z",
"start_time": "2025-03-24T20:25:09.064490Z"
}
},
"cell_type": "code",
@@ -311,8 +430,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.049702Z",
"start_time": "2025-03-24T09:48:11.047621Z"
"end_time": "2025-03-24T20:25:09.087623Z",
"start_time": "2025-03-24T20:25:09.085495Z"
}
},
"cell_type": "code",
@@ -323,11 +442,11 @@
"output_type": "stream",
"text": [
"Property Key:\n",
"[[12284 15976 959 23676 56686 51545]\n",
" [ 8349 41940 14857 24411 28369 47234]\n",
" [42434 47287 23836 29864 11461 30858]\n",
" [39973 19733 43467 29927 8960 22628]\n",
" [26608 3550 57761 58209 11329 828]]\n"
"[[ 7202 17463 46638 52425 1136 48374]\n",
" [13320 30423 16460 16440 54741 60051]\n",
" [ 7080 35309 40115 5709 22652 59355]\n",
" [62863 16450 3293 2809 14186 52151]\n",
" [49175 8694 16139 52942 5446 1365]]\n"
]
}
],
@@ -336,8 +455,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.080213Z",
"start_time": "2025-03-24T09:48:11.077878Z"
"end_time": "2025-03-24T20:25:09.115003Z",
"start_time": "2025-03-24T20:25:09.112867Z"
}
},
"cell_type": "code",
@@ -347,7 +466,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Passcode Key: [43421 54264 31716 41010 25784 51749 8406 27083 36329 63965]\n"
"Passcode Key: [64689 33923 20489 20542 33540 51906 6128 40137 14040 24585]\n"
]
}
],
@@ -356,8 +475,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.120295Z",
"start_time": "2025-03-24T09:48:11.118074Z"
"end_time": "2025-03-24T20:25:09.138929Z",
"start_time": "2025-03-24T20:25:09.136632Z"
}
},
"cell_type": "code",
@@ -367,7 +486,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Mask Key: [27744 6339 46141 38859 23071 28613 2855 48530 24494 59329]\n"
"Mask Key: [57275 32944 34918 33126 19845 13409 47088 47492 20658 16069]\n"
]
}
],
@@ -376,8 +495,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.158895Z",
"start_time": "2025-03-24T09:48:11.156729Z"
"end_time": "2025-03-24T20:25:09.171323Z",
"start_time": "2025-03-24T20:25:09.169122Z"
}
},
"cell_type": "code",
@@ -387,7 +506,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Combined Position Key: [42763 65304 30825 5938 4970 58530]\n"
"Combined Position Key: [ 6982 56074 5098 60427 26358 45400]\n"
]
}
],
@@ -396,8 +515,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.183517Z",
"start_time": "2025-03-24T09:48:11.181587Z"
"end_time": "2025-03-24T20:25:09.192115Z",
"start_time": "2025-03-24T20:25:09.189931Z"
}
},
"cell_type": "code",
@@ -407,7 +526,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"User Position Key = combined_pos_key XOR customer_pos_key: [46883 788 17499 12342 17274 44356]\n"
"User Position Key = combined_pos_key XOR customer_pos_key: [38317 4897 11591 35855 44777 3703]\n"
]
}
],
@@ -416,8 +535,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.207260Z",
"start_time": "2025-03-24T09:48:11.204729Z"
"end_time": "2025-03-24T20:25:09.213042Z",
"start_time": "2025-03-24T20:25:09.210890Z"
}
},
"cell_type": "code",
@@ -433,12 +552,12 @@
"output_type": "stream",
"text": [
"Combined Position to Properties Map:\n",
"42763: [12284 8349 42434 39973 26608]\n",
"65304: [15976 41940 47287 19733 3550]\n",
"30825: [ 959 14857 23836 43467 57761]\n",
"5938: [23676 24411 29864 29927 58209]\n",
"4970: [56686 28369 11461 8960 11329]\n",
"58530: [51545 47234 30858 22628 828]\n"
"6982: [ 7202 13320 7080 62863 49175]\n",
"56074: [17463 30423 35309 16450 8694]\n",
"5098: [46638 16460 40115 3293 16139]\n",
"60427: [52425 16440 5709 2809 52942]\n",
"26358: [ 1136 54741 22652 14186 5446]\n",
"45400: [48374 60051 59355 52151 1365]\n"
]
}
],
@@ -459,8 +578,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.235048Z",
"start_time": "2025-03-24T09:48:11.232871Z"
"end_time": "2025-03-24T20:25:09.238466Z",
"start_time": "2025-03-24T20:25:09.236286Z"
}
},
"cell_type": "code",
@@ -489,8 +608,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.484858Z",
"start_time": "2025-03-24T09:48:11.252168Z"
"end_time": "2025-03-24T20:25:09.492093Z",
"start_time": "2025-03-24T20:25:09.259155Z"
}
},
"cell_type": "code",
@@ -518,8 +637,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.722985Z",
"start_time": "2025-03-24T09:48:11.488809Z"
"end_time": "2025-03-24T20:25:09.730838Z",
"start_time": "2025-03-24T20:25:09.495722Z"
}
},
"cell_type": "code",
@@ -537,15 +656,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Key 0: [18 1 2 21 28 5]\n",
"Key 1: [12 19 26 15 10 29]\n",
"Key 2: [ 0 25 14 3 4 23]\n",
"Key 3: [ 6 7 8 27 16 11]\n",
"Key 4: [24 13 20 9 22 17]\n",
"User Passcode: [8, 15, 17, 7]\n",
"Key 0: [ 6 1 8 27 16 11]\n",
"Key 1: [18 13 14 21 22 17]\n",
"Key 2: [ 0 25 2 15 4 23]\n",
"Key 3: [24 19 20 9 10 29]\n",
"Key 4: [12 7 26 3 28 5]\n",
"User Passcode: [22, 8, 14, 12]\n",
"\n",
"Selected Keys:\n",
" [3, 1, 4, 3]\n",
" [1, 0, 1, 4]\n",
"\n"
]
}
@@ -577,8 +696,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.731909Z",
"start_time": "2025-03-24T09:48:11.729517Z"
"end_time": "2025-03-24T20:25:09.740211Z",
"start_time": "2025-03-24T20:25:09.737938Z"
}
},
"cell_type": "code",
@@ -605,8 +724,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.750757Z",
"start_time": "2025-03-24T09:48:11.748661Z"
"end_time": "2025-03-24T20:25:09.753175Z",
"start_time": "2025-03-24T20:25:09.751006Z"
}
},
"cell_type": "code",
@@ -626,8 +745,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:11.995883Z",
"start_time": "2025-03-24T09:48:11.760909Z"
"end_time": "2025-03-24T20:25:10.000010Z",
"start_time": "2025-03-24T20:25:09.768227Z"
}
},
"cell_type": "code",
@@ -652,8 +771,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:12.479529Z",
"start_time": "2025-03-24T09:48:12.009222Z"
"end_time": "2025-03-24T20:25:10.476203Z",
"start_time": "2025-03-24T20:25:10.003562Z"
}
},
"cell_type": "code",
@@ -679,10 +798,10 @@
"output_type": "stream",
"text": [
"Old User Cipher and Mask\n",
"mask: nheBuPsWD2zInvscNhsJO6Wy0kU=, code: $2b$12$bsV3i1BsLH6nHCZOPVHns.b1ARmpuJETxFPZohcPG2OKO9Mr3B1du\n",
"mask: CAB5nFpQ1LM59xYy2OREr9b7Gcc=, code: $2b$12$oy6qiM687DO5qPkEBTy/V.GXIXYFkfiTmRp1oQEBXbZ10MZMV3V.6\n",
"\n",
"New User Cipher and Mask\n",
"mask: ionSnD9+/0DS5ul8+wMyi3PNCRA=, code: $2b$12$MZejDYT1GDoyE0w1TdFGCedyBD4BY2n6VjLQW73TwJPLyjiimdpA2\n",
"mask: 1oEiOc7ZYxkUkKlVlzNUmbvoc7k=, code: $2b$12$BAKICUuJ.gx39r29krEiu./lWS18zm60dKzfZvpSTDp3LEOzHQGN2\n",
"\n"
]
}
@@ -700,8 +819,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:12.490144Z",
"start_time": "2025-03-24T09:48:12.486157Z"
"end_time": "2025-03-24T20:25:10.488540Z",
"start_time": "2025-03-24T20:25:10.484314Z"
}
},
"cell_type": "code",
@@ -734,8 +853,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:12.503462Z",
"start_time": "2025-03-24T09:48:12.501409Z"
"end_time": "2025-03-24T20:25:10.504982Z",
"start_time": "2025-03-24T20:25:10.502608Z"
}
},
"cell_type": "code",
@@ -761,8 +880,8 @@
{
"metadata": {
"ExecuteTime": {
"end_time": "2025-03-24T09:48:12.759002Z",
"start_time": "2025-03-24T09:48:12.522251Z"
"end_time": "2025-03-24T20:25:10.762626Z",
"start_time": "2025-03-24T20:25:10.523023Z"
}
},
"cell_type": "code",