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": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T20:06:28.904351Z", "end_time": "2025-03-24T20:25:08.637548Z",
"start_time": "2025-03-24T20:06:28.864248Z" "start_time": "2025-03-24T20:25:08.607886Z"
} }
}, },
"outputs": [], "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", "cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [ "source": [
"api = NKodeAPI()\n", "api = NKodeAPI()\n",
"user_icons = np.array([\n", "user_icons = np.array([\n",
@@ -51,7 +54,9 @@
" \"🦁\", \"🐻\", \"🐸\", \"🐙\", \"🦄\",\n", " \"🦁\", \"🐻\", \"🐸\", \"🐙\", \"🦄\",\n",
" \"🌟\", \"⚡\", \"🔥\", \"🍕\", \"🎉\"\n", " \"🌟\", \"⚡\", \"🔥\", \"🍕\", \"🎉\"\n",
"])" "])"
] ],
"outputs": [],
"execution_count": 2
}, },
{ {
"metadata": {}, "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", "cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [ "source": [
"policy = NKodePolicy(\n", "policy = NKodePolicy(\n",
" max_nkode_len=10,\n", " max_nkode_len=10,\n",
@@ -102,20 +110,62 @@
"print(f\"Position to Properties Map:\")\n", "print(f\"Position to Properties Map:\")\n",
"for pos_val, props in position_properties_dict.items():\n", "for pos_val, props in position_properties_dict.items():\n",
" print(f\"{pos_val}: {props}\")" " 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", "cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [ "source": [
"user_icon_keypad = user_icons.reshape(-1, keypad_size.props_per_key)\n", "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", "pos_icons_dict = dict(zip(customer.cipher.position_key, user_icon_keypad.T))\n",
"print(\"Position Value to Icons Map:\")\n", "print(\"Position Value to Icons Map:\")\n",
"for pos_val, icons in pos_icons_dict.items():\n", "for pos_val, icons in pos_icons_dict.items():\n",
" print(f\"{pos_val}: {icons}\")\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": {}, "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", "cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [ "source": [
"username = random_username()\n", "username = random_username()\n",
"signup_session_id, set_signup_keypad = api.generate_signup_keypad(customer_id, username)\n", "signup_session_id, set_signup_keypad = api.generate_signup_keypad(customer_id, username)\n",
@@ -150,8 +203,74 @@
"keypad_view(set_signup_keypad, keypad_size.numb_of_keys)\n", "keypad_view(set_signup_keypad, keypad_size.numb_of_keys)\n",
"display(Markdown(\"\"\"### Customer Properties Keypad\"\"\"))\n", "display(Markdown(\"\"\"### Customer Properties Keypad\"\"\"))\n",
"keypad_view(customer.cipher.property_key[set_signup_keypad], keypad_size.numb_of_keys)" "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": {}, "metadata": {},
"cell_type": "markdown", "cell_type": "markdown",
@@ -163,24 +282,11 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:10.726327Z", "end_time": "2025-03-24T20:25:08.729881Z",
"start_time": "2025-03-24T09:48:10.723046Z" "start_time": "2025-03-24T20:25:08.726837Z"
} }
}, },
"cell_type": "code", "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": [ "source": [
"passcode_len = 4\n", "passcode_len = 4\n",
"passcode_property_indices = np.random.choice(set_signup_keypad.reshape(-1), size=passcode_len, replace=False).tolist()\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 Icons: {user_icons[passcode_property_indices]}\")\n",
"print(f\"User Passcode Server-side properties: {customer.cipher.property_key[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}\")" "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": {}, "metadata": {},
@@ -202,8 +321,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.002815Z", "end_time": "2025-03-24T20:25:09.048762Z",
"start_time": "2025-03-24T09:48:10.759840Z" "start_time": "2025-03-24T20:25:08.811165Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -220,13 +339,13 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Key 0: [ 1 26 9 4 11]\n", "Key 0: [24 25 26 27 22]\n",
"Key 1: [19 8 3 28 17]\n", "Key 1: [18 19 2 3 16]\n",
"Key 2: [ 7 20 21 10 23]\n", "Key 2: [ 6 13 20 15 28]\n",
"Key 3: [13 14 15 16 5]\n", "Key 3: [12 1 14 9 4]\n",
"Key 4: [25 2 27 22 29]\n", "Key 4: [ 0 7 8 21 10]\n",
"Selected Keys\n", "Selected Keys\n",
"[1, 3, 1, 2]\n" "[0, 4, 3, 3]\n"
] ]
} }
], ],
@@ -240,8 +359,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.011978Z", "end_time": "2025-03-24T20:25:09.058216Z",
"start_time": "2025-03-24T09:48:11.009413Z" "start_time": "2025-03-24T20:25:09.055315Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -260,18 +379,18 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Set Key 0: ['😡' '😱' '🔥' '👽' '😴']\n", "Set Key 0: ['🐱' '🙃' '😇' '🐻' '🐸']\n",
"Confirm Key 0: ['🐶' '😱' '😍' '🍕' '👾']\n", "Confirm Key 0: ['🦄' '🌟' '' '🔥' '🐸']\n",
"Overlapping icon 🐸\n",
"Set Key 1: ['🥺' '😂' '😱' '🔥' '👽']\n",
"Confirm Key 1: ['😀' '😡' '😱' '🐻' '🥰']\n",
"Overlapping icon 😱\n", "Overlapping icon 😱\n",
"Set Key 1: ['🐶' '' '🤖' '🥰' '🎉']\n", "Set Key 2: ['🐱' '🙃' '😇' '🐻' '🐸']\n",
"Confirm Key 1: ['🙃' '😇' '🤖' '👽' '😎']\n", "Confirm Key 2: ['🤔' '😂' '😇' '🤯' '🤓']\n",
"Overlapping icon 🤖\n", "Overlapping icon 😇\n",
"Set Key 2: ['🙃' '🦁' '🤯' '🐸' '👾']\n", "Set Key 3: ['🤔' '😡' '' '😍' '🍕']\n",
"Confirm Key 2: ['🐶' '😱' '😍' '🍕' '👾']\n", "Confirm Key 3: ['🤔' '😂' '😇' '🤯' '🤓']\n",
"Overlapping icon 👾\n", "Overlapping icon 🤔\n"
"Set Key 3: ['😡' '😱' '🔥' '👽' '😴']\n",
"Confirm Key 3: ['😡' '🦁' '🐻' '🥰' '🐙']\n",
"Overlapping icon 😡\n"
] ]
} }
], ],
@@ -295,8 +414,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.030598Z", "end_time": "2025-03-24T20:25:09.069308Z",
"start_time": "2025-03-24T09:48:11.025452Z" "start_time": "2025-03-24T20:25:09.064490Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -311,8 +430,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.049702Z", "end_time": "2025-03-24T20:25:09.087623Z",
"start_time": "2025-03-24T09:48:11.047621Z" "start_time": "2025-03-24T20:25:09.085495Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -323,11 +442,11 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Property Key:\n", "Property Key:\n",
"[[12284 15976 959 23676 56686 51545]\n", "[[ 7202 17463 46638 52425 1136 48374]\n",
" [ 8349 41940 14857 24411 28369 47234]\n", " [13320 30423 16460 16440 54741 60051]\n",
" [42434 47287 23836 29864 11461 30858]\n", " [ 7080 35309 40115 5709 22652 59355]\n",
" [39973 19733 43467 29927 8960 22628]\n", " [62863 16450 3293 2809 14186 52151]\n",
" [26608 3550 57761 58209 11329 828]]\n" " [49175 8694 16139 52942 5446 1365]]\n"
] ]
} }
], ],
@@ -336,8 +455,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.080213Z", "end_time": "2025-03-24T20:25:09.115003Z",
"start_time": "2025-03-24T09:48:11.077878Z" "start_time": "2025-03-24T20:25:09.112867Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -347,7 +466,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "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": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.120295Z", "end_time": "2025-03-24T20:25:09.138929Z",
"start_time": "2025-03-24T09:48:11.118074Z" "start_time": "2025-03-24T20:25:09.136632Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -367,7 +486,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "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": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.158895Z", "end_time": "2025-03-24T20:25:09.171323Z",
"start_time": "2025-03-24T09:48:11.156729Z" "start_time": "2025-03-24T20:25:09.169122Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -387,7 +506,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "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": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.183517Z", "end_time": "2025-03-24T20:25:09.192115Z",
"start_time": "2025-03-24T09:48:11.181587Z" "start_time": "2025-03-24T20:25:09.189931Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -407,7 +526,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "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": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.207260Z", "end_time": "2025-03-24T20:25:09.213042Z",
"start_time": "2025-03-24T09:48:11.204729Z" "start_time": "2025-03-24T20:25:09.210890Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -433,12 +552,12 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Combined Position to Properties Map:\n", "Combined Position to Properties Map:\n",
"42763: [12284 8349 42434 39973 26608]\n", "6982: [ 7202 13320 7080 62863 49175]\n",
"65304: [15976 41940 47287 19733 3550]\n", "56074: [17463 30423 35309 16450 8694]\n",
"30825: [ 959 14857 23836 43467 57761]\n", "5098: [46638 16460 40115 3293 16139]\n",
"5938: [23676 24411 29864 29927 58209]\n", "60427: [52425 16440 5709 2809 52942]\n",
"4970: [56686 28369 11461 8960 11329]\n", "26358: [ 1136 54741 22652 14186 5446]\n",
"58530: [51545 47234 30858 22628 828]\n" "45400: [48374 60051 59355 52151 1365]\n"
] ]
} }
], ],
@@ -459,8 +578,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.235048Z", "end_time": "2025-03-24T20:25:09.238466Z",
"start_time": "2025-03-24T09:48:11.232871Z" "start_time": "2025-03-24T20:25:09.236286Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -489,8 +608,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.484858Z", "end_time": "2025-03-24T20:25:09.492093Z",
"start_time": "2025-03-24T09:48:11.252168Z" "start_time": "2025-03-24T20:25:09.259155Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -518,8 +637,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.722985Z", "end_time": "2025-03-24T20:25:09.730838Z",
"start_time": "2025-03-24T09:48:11.488809Z" "start_time": "2025-03-24T20:25:09.495722Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -537,15 +656,15 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Key 0: [18 1 2 21 28 5]\n", "Key 0: [ 6 1 8 27 16 11]\n",
"Key 1: [12 19 26 15 10 29]\n", "Key 1: [18 13 14 21 22 17]\n",
"Key 2: [ 0 25 14 3 4 23]\n", "Key 2: [ 0 25 2 15 4 23]\n",
"Key 3: [ 6 7 8 27 16 11]\n", "Key 3: [24 19 20 9 10 29]\n",
"Key 4: [24 13 20 9 22 17]\n", "Key 4: [12 7 26 3 28 5]\n",
"User Passcode: [8, 15, 17, 7]\n", "User Passcode: [22, 8, 14, 12]\n",
"\n", "\n",
"Selected Keys:\n", "Selected Keys:\n",
" [3, 1, 4, 3]\n", " [1, 0, 1, 4]\n",
"\n" "\n"
] ]
} }
@@ -577,8 +696,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.731909Z", "end_time": "2025-03-24T20:25:09.740211Z",
"start_time": "2025-03-24T09:48:11.729517Z" "start_time": "2025-03-24T20:25:09.737938Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -605,8 +724,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.750757Z", "end_time": "2025-03-24T20:25:09.753175Z",
"start_time": "2025-03-24T09:48:11.748661Z" "start_time": "2025-03-24T20:25:09.751006Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -626,8 +745,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:11.995883Z", "end_time": "2025-03-24T20:25:10.000010Z",
"start_time": "2025-03-24T09:48:11.760909Z" "start_time": "2025-03-24T20:25:09.768227Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -652,8 +771,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:12.479529Z", "end_time": "2025-03-24T20:25:10.476203Z",
"start_time": "2025-03-24T09:48:12.009222Z" "start_time": "2025-03-24T20:25:10.003562Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -679,10 +798,10 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Old User Cipher and Mask\n", "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", "\n",
"New User Cipher and Mask\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" "\n"
] ]
} }
@@ -700,8 +819,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:12.490144Z", "end_time": "2025-03-24T20:25:10.488540Z",
"start_time": "2025-03-24T09:48:12.486157Z" "start_time": "2025-03-24T20:25:10.484314Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -734,8 +853,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:12.503462Z", "end_time": "2025-03-24T20:25:10.504982Z",
"start_time": "2025-03-24T09:48:12.501409Z" "start_time": "2025-03-24T20:25:10.502608Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -761,8 +880,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T09:48:12.759002Z", "end_time": "2025-03-24T20:25:10.762626Z",
"start_time": "2025-03-24T09:48:12.522251Z" "start_time": "2025-03-24T20:25:10.523023Z"
} }
}, },
"cell_type": "code", "cell_type": "code",

View File

@@ -19,17 +19,23 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T20:18:04.947152Z", "end_time": "2025-03-24T20:25:00.701367Z",
"start_time": "2025-03-24T20:18:04.916604Z" "start_time": "2025-03-24T20:25:00.698108Z"
} }
}, },
"outputs": [], "outputs": [],
"execution_count": 1 "execution_count": 8
}, },
{ {
"metadata": {}, "metadata": {},
"cell_type": "markdown", "cell_type": "markdown",
"source": "## Initialize nKode API" "source": [
"## Initialize nKode API and Create Customer\n",
"#### nKode Customer\n",
"An nKode customer is business has employees (users). An nKode API can service many customers each with their own users.\n",
"Each customer specifies a keypad size and a nkode policy.\n",
"The keypad can't be dispersable (`numb_of_keys < properties_per_key`)"
]
}, },
{ {
"cell_type": "code", "cell_type": "code",
@@ -51,35 +57,41 @@
"metadata": { "metadata": {
"collapsed": false, "collapsed": false,
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T20:18:04.960698Z", "end_time": "2025-03-24T20:25:00.708966Z",
"start_time": "2025-03-24T20:18:04.950723Z" "start_time": "2025-03-24T20:25:00.704877Z"
} }
}, },
"outputs": [], "outputs": [],
"execution_count": 2 "execution_count": 9
}, },
{ {
"metadata": {}, "metadata": {},
"cell_type": "markdown", "cell_type": "markdown",
"source": [ "source": [
"## nKode Enrollment\n", "## nKode Enrollment\n",
"Users enroll in three steps:\n" "Users enroll in three steps:\n",
"1. Create Signup Session\n",
"2. Set nKode\n",
"3. Confirm nKode\n",
"\n",
"#### Create Signup Session\n",
"A user, associate with customer (or business), specifies a username and receives a signup_session_id and set_keypad. The keypad is a index array. It tells the client how to sort the user's icons."
] ]
}, },
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T20:18:04.989029Z", "end_time": "2025-03-24T20:25:00.717550Z",
"start_time": "2025-03-24T20:18:04.986797Z" "start_time": "2025-03-24T20:25:00.715159Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"username = random_username()\n", "username = random_username()\n",
"signup_session_id, set_signup_keypad = api.generate_signup_keypad(customer_id, username)" "signup_session_id, set_keypad = api.generate_signup_keypad(customer_id, username)"
], ],
"outputs": [], "outputs": [],
"execution_count": 3 "execution_count": 10
}, },
{ {
"metadata": {}, "metadata": {},
@@ -92,32 +104,32 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T20:18:04.997252Z", "end_time": "2025-03-24T20:25:00.726553Z",
"start_time": "2025-03-24T20:18:04.995177Z" "start_time": "2025-03-24T20:25:00.724282Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"passcode_len = 4\n", "passcode_len = 4\n",
"passcode_property_indices = np.random.choice(set_signup_keypad.reshape(-1), size=passcode_len, replace=False).tolist()\n", "passcode_property_indices = np.random.choice(set_keypad.reshape(-1), size=passcode_len, replace=False).tolist()\n",
"selected_keys_set = select_keys_with_passcode_values(passcode_property_indices, set_signup_keypad, keypad_size.numb_of_keys)" "selected_keys_set = select_keys_with_passcode_values(passcode_property_indices, set_keypad, keypad_size.numb_of_keys)"
], ],
"outputs": [], "outputs": [],
"execution_count": 4 "execution_count": 11
}, },
{ {
"metadata": {}, "metadata": {},
"cell_type": "markdown", "cell_type": "markdown",
"source": [ "source": [
"### Confirm nKode\n", "### Confirm nKode\n",
"Submit the set key entry to render the confirm keypad." "The user enter then submits their key entry. The server returns the confirm_keypad, another index array and dispersion of the set_keypad."
] ]
}, },
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T20:18:05.239384Z", "end_time": "2025-03-24T20:25:00.967386Z",
"start_time": "2025-03-24T20:18:05.002825Z" "start_time": "2025-03-24T20:25:00.732130Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -128,7 +140,7 @@
"assert success" "assert success"
], ],
"outputs": [], "outputs": [],
"execution_count": 5 "execution_count": 12
}, },
{ {
"metadata": {}, "metadata": {},
@@ -142,8 +154,8 @@
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T20:18:05.478978Z", "end_time": "2025-03-24T20:25:01.204427Z",
"start_time": "2025-03-24T20:18:05.245767Z" "start_time": "2025-03-24T20:25:00.973454Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -154,24 +166,24 @@
"assert success" "assert success"
], ],
"outputs": [], "outputs": [],
"execution_count": 6 "execution_count": 13
}, },
{ {
"metadata": {}, "metadata": {},
"cell_type": "markdown", "cell_type": "markdown",
"source": [ "source": [
"## Renew Properties\n", "## Renew Properties\n",
"Replace server-side ciphers keys and nkode hash with new values.\n",
"1. Renew Customer Properties\n", "1. Renew Customer Properties\n",
"2. Renew User Keys\n", "2. Renew User Keys\n",
"3. Refresh User on Login\n", "3. Refresh User on Login"
"\n"
] ]
}, },
{ {
"metadata": { "metadata": {
"ExecuteTime": { "ExecuteTime": {
"end_time": "2025-03-24T20:18:05.950627Z", "end_time": "2025-03-24T20:25:01.677259Z",
"start_time": "2025-03-24T20:18:05.484941Z" "start_time": "2025-03-24T20:25:01.209950Z"
} }
}, },
"cell_type": "code", "cell_type": "code",
@@ -183,7 +195,7 @@
"assert success" "assert success"
], ],
"outputs": [], "outputs": [],
"execution_count": 7 "execution_count": 14
} }
], ],
"metadata": { "metadata": {