Advertisement
Guest User

Untitled

a guest
Mar 6th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.62 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 6,
  6. "metadata": {},
  7. "outputs": [],
  8. "source": [
  9. "import hashlib\n",
  10. "def sha1digest(x):\n",
  11. " return hashlib.sha1(x.encode('utf-8')).hexdigest().upper()"
  12. ]
  13. },
  14. {
  15. "cell_type": "code",
  16. "execution_count": 20,
  17. "metadata": {},
  18. "outputs": [],
  19. "source": [
  20. "most_common_passwords = {}\n",
  21. "order = []\n",
  22. "with open('../Software/pwned-passwords-2.0.txt') as f:\n",
  23. " for line in f:\n",
  24. " digest, count = line.split(':')\n",
  25. " most_common_passwords[digest] = {'count': count, 'plaintext': None}\n",
  26. " order.append(digest)\n",
  27. " if len(most_common_passwords) > 100000:\n",
  28. " break"
  29. ]
  30. },
  31. {
  32. "cell_type": "code",
  33. "execution_count": 23,
  34. "metadata": {
  35. "scrolled": false
  36. },
  37. "outputs": [
  38. {
  39. "name": "stdout",
  40. "output_type": "stream",
  41. "text": [
  42. "guess a password: qwer\n",
  43. "that's the #986 most common password\n",
  44. "guess a password: 1234\n",
  45. "that's the #15 most common password\n",
  46. "guess a password: lkjnf\n",
  47. "that's not in the top #100000!\n",
  48. "guess a password: princess\n",
  49. "that's the #55 most common password\n",
  50. "guess a password: Princess\n",
  51. "that's the #7934 most common password\n",
  52. "guess a password: peanut\n",
  53. "that's the #312 most common password\n",
  54. "guess a password: apple\n",
  55. "that's the #141 most common password\n",
  56. "guess a password: abcde\n",
  57. "that's the #1777 most common password\n",
  58. "guess a password: abcdef\n",
  59. "that's the #273 most common password\n",
  60. "guess a password: butter\n",
  61. "that's the #1328 most common password\n",
  62. "guess a password: keyboard\n",
  63. "that's the #4609 most common password\n",
  64. "guess a password: qwerty\n",
  65. "that's the #3 most common password\n",
  66. "guess a password: 12345\n",
  67. "that's the #10 most common password\n",
  68. "guess a password: 123456\n",
  69. "that's the #1 most common password\n",
  70. "guess a password: 12345678\n",
  71. "that's the #6 most common password\n",
  72. "guess a password: qwQW\n",
  73. "that's not in the top #100000!\n",
  74. "guess a password: !@#$%^\n",
  75. "that's the #17168 most common password\n",
  76. "guess a password: !@#$\n",
  77. "that's not in the top #100000!\n",
  78. "guess a password: !@#$%^&*\n",
  79. "that's the #71654 most common password\n",
  80. "guess a password: Battery\n",
  81. "that's not in the top #100000!\n",
  82. "guess a password: battery\n",
  83. "that's the #18293 most common password\n",
  84. "guess a password: correct horse\n",
  85. "that's not in the top #100000!\n",
  86. "guess a password: horse\n",
  87. "that's the #4190 most common password\n",
  88. "guess a password: correct\n",
  89. "that's the #55408 most common password\n",
  90. "guess a password: staple\n",
  91. "that's the #95567 most common password\n",
  92. "guess a password: baby\n",
  93. "that's the #853 most common password\n",
  94. "guess a password: sha1\n",
  95. "that's not in the top #100000!\n",
  96. "guess a password: top\n",
  97. "that's the #26658 most common password\n",
  98. "guess a password: hat\n",
  99. "that's the #82601 most common password\n",
  100. "guess a password: dick\n",
  101. "that's the #3000 most common password\n",
  102. "guess a password: ass\n",
  103. "that's the #4984 most common password\n",
  104. "guess a password: tits\n",
  105. "that's the #10117 most common password\n",
  106. "guess a password: pussy\n",
  107. "that's the #590 most common password\n",
  108. "guess a password: fucker\n",
  109. "that's the #570 most common password\n",
  110. "guess a password: motherfucker\n",
  111. "that's the #4387 most common password\n",
  112. "guess a password: shit\n",
  113. "that's the #2774 most common password\n",
  114. "guess a password: piss\n",
  115. "that's the #84246 most common password\n",
  116. "guess a password: cock\n",
  117. "that's the #8567 most common password\n",
  118. "guess a password: zxcvbn\n",
  119. "that's the #124 most common password\n",
  120. "guess a password: zxcv\n",
  121. "that's the #7124 most common password\n",
  122. "guess a password: asdf\n",
  123. "that's the #83 most common password\n",
  124. "guess a password: ASDF\n",
  125. "that's the #72240 most common password\n",
  126. "guess a password: Asdf\n",
  127. "that's not in the top #100000!\n",
  128. "guess a password: Qwerty\n",
  129. "that's the #4856 most common password\n",
  130. "guess a password: QWERTY\n",
  131. "that's the #2454 most common password\n",
  132. "guess a password: qwer1234\n",
  133. "that's the #105 most common password\n",
  134. "guess a password: QWER1234\n",
  135. "that's the #49431 most common password\n",
  136. "guess a password: !@#$1234\n",
  137. "that's not in the top #100000!\n",
  138. "guess a password: 1234!@#$\n",
  139. "that's the #81723 most common password\n",
  140. "guess a password: 1234qwer\n",
  141. "that's the #57 most common password\n",
  142. "guess a password: 1234qwerasdf\n",
  143. "that's the #22724 most common password\n",
  144. "guess a password: 1234qwerasdfzxcv\n",
  145. "that's the #35054 most common password\n",
  146. "guess a password: 123456qwerty\n",
  147. "that's the #1394 most common password\n",
  148. "guess a password: qwerty123456\n",
  149. "that's the #697 most common password\n",
  150. "guess a password: jkl;\n",
  151. "that's not in the top #100000!\n",
  152. "guess a password: ;lkj\n",
  153. "that's not in the top #100000!\n",
  154. "guess a password: qwertyuiop\n",
  155. "that's the #17 most common password\n",
  156. "guess a password: asdfghjkl\n",
  157. "that's the #48 most common password\n",
  158. "guess a password: zxcvbnm\n",
  159. "that's the #44 most common password\n",
  160. "guess a password: qazwsx\n",
  161. "that's the #52 most common password\n",
  162. "guess a password: qazwsxedc\n",
  163. "that's the #154 most common password\n",
  164. "guess a password: qazwsxedcrfv\n",
  165. "that's the #2602 most common password\n",
  166. "guess a password: qazwsxedcrfvtgbyhnujm\n",
  167. "that's not in the top #100000!\n",
  168. "guess a password: qazwsxedcrfvtgb\n",
  169. "that's the #15882 most common password\n",
  170. "guess a password: 1qaz2wsx\n",
  171. "that's the #26 most common password\n",
  172. "guess a password: 123qweasdzxc\n",
  173. "that's the #875 most common password\n",
  174. "guess a password: 111\n",
  175. "that's the #677 most common password\n",
  176. "guess a password: 1\n",
  177. "that's the #196 most common password\n",
  178. "guess a password: q\n"
  179. ]
  180. }
  181. ],
  182. "source": [
  183. "while True:\n",
  184. " trial = input('guess a password: ').strip()\n",
  185. " if trial == 'q':\n",
  186. " break\n",
  187. " digest = sha1digest(trial)\n",
  188. " try:\n",
  189. " nth_most = order.index(digest) + 1\n",
  190. " except ValueError:\n",
  191. " print('that\\'s not in the top #100000!')\n",
  192. " continue\n",
  193. "\n",
  194. " most_common_passwords[digest]['plaintext'] = trial\n",
  195. " print('that\\'s the #{} most common password'.format(nth_most))"
  196. ]
  197. },
  198. {
  199. "cell_type": "code",
  200. "execution_count": null,
  201. "metadata": {},
  202. "outputs": [],
  203. "source": []
  204. }
  205. ],
  206. "metadata": {
  207. "kernelspec": {
  208. "display_name": "Python 3",
  209. "language": "python",
  210. "name": "python3"
  211. },
  212. "language_info": {
  213. "codemirror_mode": {
  214. "name": "ipython",
  215. "version": 3
  216. },
  217. "file_extension": ".py",
  218. "mimetype": "text/x-python",
  219. "name": "python",
  220. "nbconvert_exporter": "python",
  221. "pygments_lexer": "ipython3",
  222. "version": "3.6.4"
  223. }
  224. },
  225. "nbformat": 4,
  226. "nbformat_minor": 2
  227. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement