},
{
"cell_type": "code",
- "execution_count": 23,
+ "execution_count": 4,
"metadata": {},
"outputs": [
{
"('a', 'z', 'z', 'a')"
]
},
- "execution_count": 23,
+ "execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": 5,
"metadata": {
"collapsed": true
},
},
{
"cell_type": "code",
- "execution_count": 26,
- "metadata": {
- "collapsed": true
- },
+ "execution_count": 7,
+ "metadata": {},
"outputs": [],
"source": [
"def whash1(word, show_steps=False):\n",
" print('| `{}` | {} | `{}` | {} | {} | {} | `{}` |'.format(\n",
" ''.join(h_before), \n",
" (o(h_before[0]), o(h_before[1])),\n",
- " l, | old code | code as<br>numbers | passphrase<br/>letter | number of<br/>letter | new first<br/>part of code |new second<br/>part of code | new code |\n",
- "|:---|:---|:---|:---|:---|:---|:---|\n",
- "| `th` | (20, 8) | `e` | 5 | 28 | 13 | `bm` |\n",
- "| `bm` | (2, 13) | `c` | 3 | 15 | 16 | `op` |\n",
- "| `op` | (15, 16) | `a` | 1 | 31 | 17 | `eq` |\n",
- "| `eq` | (5, 17) | `t` | 20 | 22 | 37 | `vk` |\n",
+ " l, \n",
" o(l), \n",
" o(h_before[0]) + o(h_before[1]), \n",
" o(h_before[1]) + o(l), \n",
},
{
"cell_type": "code",
- "execution_count": 27,
+ "execution_count": 8,
"metadata": {},
"outputs": [
{
"'vk'"
]
},
- "execution_count": 27,
+ "execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 9,
"metadata": {
"collapsed": true
},
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 10,
"metadata": {},
"outputs": [
{
"'mc'"
]
},
- "execution_count": 8,
+ "execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
"1. \"Multiply\" the second letter of the code by `alpha` then add the first letter of the code, replacing the first code letter\n",
"2. \"Multiply\" the current letter of the pass phrase by `beta` and add the second letter of the code, replacing the second letter of the code\n",
"\n",
- "\"Multiplying\" letters is done by converting the letters to their position in the alphabet (starting at one) and multiplying. For instance, to multiply `u` by 11, convert `u` to `21`, multiply by 11 (`21` × `11` = `231`), then convert back to a letter (`231` is larger than 26, so it becomes `22`, which is `w`).\n",
+ "\"Multiplying\" letters is done by converting the letters to their position in the alphabet (starting at one) and multiplying. For instance, to multiply `u` by 11, convert `u` to `21`, multiply by 11 (`21` × `11` = `231`), then convert back to a letter (`231` is larger than 26, so it becomes `23`, which is `w`).\n",
"\n",
"Again, anything that isn't a lower-case letter is ignored.\n",
"\n",
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
- "(21, 231, 22, 'w')"
+ "(21, 231, 23, 'w')"
]
},
- "execution_count": 9,
+ "execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "o('u'), o('u') * 11, (o('u') * 11 - 1) % 26, c(o('u') * 11)"
+ "o('u'), o('u') * 11, (o('u') * 11 - 1) % 26 + 1, c(o('u') * 11)"
]
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 12,
"metadata": {},
"outputs": [
{
"(18, 9, 45, 63, 'k')"
]
},
- "execution_count": 16,
+ "execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 13,
"metadata": {},
"outputs": [
{
"(9, 20, 220, 229, 'u')"
]
},
- "execution_count": 17,
+ "execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": 14,
"metadata": {
"collapsed": true
},
},
{
"cell_type": "code",
- "execution_count": 25,
+ "execution_count": 15,
"metadata": {},
"outputs": [
{
"'vl'"
]
},
- "execution_count": 25,
+ "execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 16,
"metadata": {},
"outputs": [
{
"'qb'"
]
},
- "execution_count": 20,
+ "execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}