passlib 1.7.3__tar.gz → 1.9.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. passlib-1.9.5/.gitignore +16 -0
  2. passlib-1.9.5/CHANGELOG.md +125 -0
  3. passlib-1.9.5/PKG-INFO +90 -0
  4. passlib-1.9.5/README.md +54 -0
  5. passlib-1.9.5/Taskfile.yml +54 -0
  6. passlib-1.9.5/docs/api/index.md +43 -0
  7. passlib-1.9.5/docs/api/passlib.apache.md +71 -0
  8. passlib-1.9.5/docs/api/passlib.apps.md +235 -0
  9. passlib-1.9.5/docs/api/passlib.context.md +319 -0
  10. passlib-1.9.5/docs/api/passlib.crypto.des.md +22 -0
  11. passlib-1.9.5/docs/api/passlib.crypto.digest.md +37 -0
  12. passlib-1.9.5/docs/api/passlib.crypto.md +11 -0
  13. passlib-1.9.5/docs/api/passlib.exc.md +45 -0
  14. passlib-1.9.5/docs/api/passlib.ext.django.md +181 -0
  15. passlib-1.9.5/docs/api/passlib.hash.apr_md5_crypt.md +36 -0
  16. passlib-1.9.5/docs/api/passlib.hash.argon2.md +117 -0
  17. passlib-1.9.5/docs/api/passlib.hash.atlassian_pbkdf2_sha1.md +46 -0
  18. passlib-1.9.5/docs/api/passlib.hash.bcrypt.md +53 -0
  19. passlib-1.9.5/docs/api/passlib.hash.bcrypt_sha256.md +70 -0
  20. passlib-1.9.5/docs/api/passlib.hash.bigcrypt.md +81 -0
  21. passlib-1.7.3/docs/lib/passlib.hash.bsdi_crypt.rst → passlib-1.9.5/docs/api/passlib.hash.bsdi_crypt.md +55 -66
  22. passlib-1.9.5/docs/api/passlib.hash.cisco_asa.md +20 -0
  23. passlib-1.9.5/docs/api/passlib.hash.cisco_pix.md +196 -0
  24. passlib-1.7.3/docs/lib/passlib.hash.cisco_type7.rst → passlib-1.9.5/docs/api/passlib.hash.cisco_type7.md +48 -60
  25. passlib-1.7.3/docs/lib/passlib.hash.crypt16.rst → passlib-1.9.5/docs/api/passlib.hash.crypt16.md +35 -46
  26. passlib-1.9.5/docs/api/passlib.hash.cta_pbkdf2_sha1.md +48 -0
  27. passlib-1.7.3/docs/lib/passlib.hash.des_crypt.rst → passlib-1.9.5/docs/api/passlib.hash.des_crypt.md +47 -50
  28. passlib-1.9.5/docs/api/passlib.hash.django_std.md +261 -0
  29. passlib-1.9.5/docs/api/passlib.hash.dlitz_pbkdf2_sha1.md +62 -0
  30. passlib-1.9.5/docs/api/passlib.hash.fshp.md +114 -0
  31. passlib-1.9.5/docs/api/passlib.hash.grub_pbkdf2_sha512.md +44 -0
  32. passlib-1.9.5/docs/api/passlib.hash.hex_digests.md +49 -0
  33. passlib-1.9.5/docs/api/passlib.hash.ldap_crypt.md +40 -0
  34. passlib-1.9.5/docs/api/passlib.hash.ldap_other.md +28 -0
  35. passlib-1.9.5/docs/api/passlib.hash.ldap_pbkdf2_digest.md +28 -0
  36. passlib-1.9.5/docs/api/passlib.hash.ldap_std.md +113 -0
  37. passlib-1.7.3/docs/lib/passlib.hash.lmhash.rst → passlib-1.9.5/docs/api/passlib.hash.lmhash.md +59 -69
  38. passlib-1.9.5/docs/api/passlib.hash.md +220 -0
  39. passlib-1.7.3/docs/lib/passlib.hash.md5_crypt.rst → passlib-1.9.5/docs/api/passlib.hash.md5_crypt.md +59 -83
  40. passlib-1.9.5/docs/api/passlib.hash.msdcc.md +82 -0
  41. passlib-1.9.5/docs/api/passlib.hash.msdcc2.md +93 -0
  42. passlib-1.9.5/docs/api/passlib.hash.mssql2000.md +84 -0
  43. passlib-1.9.5/docs/api/passlib.hash.mssql2005.md +71 -0
  44. passlib-1.9.5/docs/api/passlib.hash.mysql323.md +57 -0
  45. passlib-1.9.5/docs/api/passlib.hash.mysql41.md +38 -0
  46. passlib-1.9.5/docs/api/passlib.hash.nthash.md +73 -0
  47. passlib-1.9.5/docs/api/passlib.hash.oracle10.md +106 -0
  48. passlib-1.9.5/docs/api/passlib.hash.oracle11.md +77 -0
  49. passlib-1.9.5/docs/api/passlib.hash.pbkdf2_digest.md +94 -0
  50. passlib-1.9.5/docs/api/passlib.hash.phpass.md +65 -0
  51. passlib-1.9.5/docs/api/passlib.hash.plaintext.md +30 -0
  52. passlib-1.9.5/docs/api/passlib.hash.postgres_md5.md +64 -0
  53. passlib-1.9.5/docs/api/passlib.hash.scram.md +172 -0
  54. passlib-1.9.5/docs/api/passlib.hash.scrypt.md +112 -0
  55. passlib-1.9.5/docs/api/passlib.hash.sha1_crypt.md +105 -0
  56. passlib-1.7.3/docs/lib/passlib.hash.sha256_crypt.rst → passlib-1.9.5/docs/api/passlib.hash.sha256_crypt.md +53 -60
  57. passlib-1.9.5/docs/api/passlib.hash.sha512_crypt.md +39 -0
  58. passlib-1.9.5/docs/api/passlib.hash.sun_md5_crypt.md +180 -0
  59. passlib-1.9.5/docs/api/passlib.hash.unix_disabled.md +41 -0
  60. passlib-1.9.5/docs/api/passlib.hosts.md +116 -0
  61. passlib-1.9.5/docs/api/passlib.ifc.md +318 -0
  62. passlib-1.9.5/docs/api/passlib.pwd.md +36 -0
  63. passlib-1.9.5/docs/api/passlib.registry.md +74 -0
  64. passlib-1.9.5/docs/api/passlib.totp.md +105 -0
  65. passlib-1.9.5/docs/api/passlib.utils.binary.md +67 -0
  66. passlib-1.9.5/docs/api/passlib.utils.des.md +19 -0
  67. passlib-1.9.5/docs/api/passlib.utils.handlers.md +148 -0
  68. passlib-1.9.5/docs/api/passlib.utils.md +120 -0
  69. passlib-1.9.5/docs/api/passlib.utils.pbkdf2.md +23 -0
  70. passlib-1.9.5/docs/changelog/1.5.md +85 -0
  71. passlib-1.9.5/docs/changelog/1.6.md +179 -0
  72. passlib-1.9.5/docs/changelog/1.7.md +265 -0
  73. passlib-1.9.5/docs/changelog/ancient.md +88 -0
  74. passlib-1.9.5/docs/changelog/index.md +11 -0
  75. passlib-1.9.5/docs/griffe_warning.py +8 -0
  76. passlib-1.9.5/docs/guide/context-tutorial.md +473 -0
  77. passlib-1.9.5/docs/guide/hash-tutorial.md +227 -0
  78. passlib-1.9.5/docs/guide/install.md +54 -0
  79. passlib-1.9.5/docs/guide/overview.md +57 -0
  80. passlib-1.9.5/docs/guide/quickstart.md +134 -0
  81. passlib-1.9.5/docs/guide/totp-tutorial.md +625 -0
  82. passlib-1.9.5/docs/index.md +75 -0
  83. passlib-1.7.3/docs/faq.rst → passlib-1.9.5/docs/reference/faq.md +18 -25
  84. passlib-1.9.5/docs/reference/license.md +37 -0
  85. passlib-1.9.5/docs/reference/modular-crypt-format.md +189 -0
  86. {passlib-1.7.3 → passlib-1.9.5}/passlib/__init__.py +1 -1
  87. passlib-1.9.5/passlib/_logging.py +3 -0
  88. passlib-1.9.5/passlib/_protocols.py +33 -0
  89. {passlib-1.7.3 → passlib-1.9.5}/passlib/apache.py +189 -338
  90. passlib-1.9.5/passlib/apps.py +215 -0
  91. {passlib-1.7.3 → passlib-1.9.5}/passlib/context.py +255 -947
  92. {passlib-1.7.3 → passlib-1.9.5}/passlib/crypto/_blowfish/__init__.py +24 -40
  93. passlib-1.9.5/passlib/crypto/_blowfish/_gen_files.py +238 -0
  94. passlib-1.9.5/passlib/crypto/_blowfish/base.py +1212 -0
  95. passlib-1.9.5/passlib/crypto/_blowfish/unrolled.py +1664 -0
  96. passlib-1.9.5/passlib/crypto/_md4.py +229 -0
  97. passlib-1.9.5/passlib/crypto/des.py +2250 -0
  98. {passlib-1.7.3 → passlib-1.9.5}/passlib/crypto/digest.py +143 -435
  99. {passlib-1.7.3 → passlib-1.9.5}/passlib/crypto/scrypt/__init__.py +51 -59
  100. {passlib-1.7.3 → passlib-1.9.5}/passlib/crypto/scrypt/_builtin.py +25 -49
  101. passlib-1.9.5/passlib/crypto/scrypt/_gen_files.py +142 -0
  102. passlib-1.9.5/passlib/crypto/scrypt/_salsa.py +180 -0
  103. {passlib-1.7.3 → passlib-1.9.5}/passlib/exc.py +69 -51
  104. passlib-1.9.5/passlib/ext/django/models.py +21 -0
  105. {passlib-1.7.3 → passlib-1.9.5}/passlib/ext/django/utils.py +188 -243
  106. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/argon2.py +256 -266
  107. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/bcrypt.py +233 -480
  108. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/cisco.py +52 -96
  109. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/des_crypt.py +93 -196
  110. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/digests.py +33 -52
  111. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/django.py +76 -78
  112. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/fshp.py +47 -76
  113. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/ldap_digests.py +61 -64
  114. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/md5_crypt.py +62 -122
  115. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/misc.py +31 -99
  116. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/mssql.py +19 -46
  117. passlib-1.9.5/passlib/handlers/mysql.py +92 -0
  118. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/oracle.py +29 -64
  119. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/pbkdf2.py +104 -125
  120. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/phpass.py +24 -49
  121. passlib-1.9.5/passlib/handlers/postgres.py +34 -0
  122. passlib-1.9.5/passlib/handlers/roundup.py +18 -0
  123. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/scram.py +62 -112
  124. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/scrypt.py +83 -109
  125. passlib-1.9.5/passlib/handlers/sha1_crypt.py +121 -0
  126. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/sha2_crypt.py +206 -178
  127. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/sun_md5_crypt.py +71 -100
  128. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/windows.py +38 -73
  129. {passlib-1.7.3 → passlib-1.9.5}/passlib/hash.py +59 -21
  130. passlib-1.9.5/passlib/hosts.py +85 -0
  131. {passlib-1.7.3 → passlib-1.9.5}/passlib/ifc.py +32 -78
  132. {passlib-1.7.3 → passlib-1.9.5}/passlib/pwd.py +52 -152
  133. {passlib-1.7.3 → passlib-1.9.5}/passlib/registry.py +163 -163
  134. {passlib-1.7.3 → passlib-1.9.5}/passlib/totp.py +230 -286
  135. passlib-1.9.5/passlib/utils/__init__.py +901 -0
  136. {passlib-1.7.3 → passlib-1.9.5}/passlib/utils/binary.py +178 -210
  137. passlib-1.9.5/passlib/utils/compat/__init__.py +141 -0
  138. {passlib-1.7.3 → passlib-1.9.5}/passlib/utils/decor.py +51 -64
  139. passlib-1.9.5/passlib/utils/des.py +31 -0
  140. {passlib-1.7.3 → passlib-1.9.5}/passlib/utils/handlers.py +477 -572
  141. passlib-1.9.5/passlib/utils/md4.py +25 -0
  142. {passlib-1.7.3 → passlib-1.9.5}/passlib/utils/pbkdf2.py +28 -49
  143. passlib-1.9.5/properdocs.yml +163 -0
  144. passlib-1.9.5/pyproject.toml +249 -0
  145. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/_test_bad_register.py +7 -3
  146. passlib-1.9.5/tests/conftest.py +24 -0
  147. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/sample1b.cfg +9 -9
  148. passlib-1.9.5/tests/test_apache.py +327 -0
  149. passlib-1.9.5/tests/test_apache_pytest.py +519 -0
  150. passlib-1.9.5/tests/test_apps.py +136 -0
  151. passlib-1.9.5/tests/test_context.py +1902 -0
  152. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/test_crypto_builtin_md4.py +56 -59
  153. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/test_crypto_des.py +82 -61
  154. passlib-1.9.5/tests/test_crypto_digest.py +687 -0
  155. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/test_crypto_scrypt.py +237 -229
  156. passlib-1.9.5/tests/test_ext_django.py +1047 -0
  157. passlib-1.9.5/tests/test_handlers.py +1883 -0
  158. passlib-1.9.5/tests/test_handlers_argon2.py +742 -0
  159. passlib-1.9.5/tests/test_handlers_bcrypt.py +676 -0
  160. passlib-1.9.5/tests/test_handlers_cisco.py +453 -0
  161. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/test_handlers_django.py +169 -137
  162. passlib-1.9.5/tests/test_handlers_pbkdf2.py +508 -0
  163. passlib-1.9.5/tests/test_handlers_scrypt.py +111 -0
  164. passlib-1.9.5/tests/test_hosts.py +99 -0
  165. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/test_pwd.py +69 -79
  166. passlib-1.9.5/tests/test_registry.py +281 -0
  167. passlib-1.9.5/tests/test_totp.py +1686 -0
  168. passlib-1.9.5/tests/test_utils.py +1134 -0
  169. passlib-1.9.5/tests/test_utils_handlers.py +871 -0
  170. passlib-1.9.5/tests/test_utils_md4.py +26 -0
  171. passlib-1.9.5/tests/test_utils_pbkdf2.py +338 -0
  172. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/utils.py +973 -1099
  173. passlib-1.9.5/tests/utils_.py +21 -0
  174. passlib-1.9.5/uv.lock +1750 -0
  175. passlib-1.7.3/MANIFEST.in +0 -3
  176. passlib-1.7.3/PKG-INFO +0 -58
  177. passlib-1.7.3/README +0 -72
  178. passlib-1.7.3/docs/_fragments/asa_verify_callout.rst +0 -15
  179. passlib-1.7.3/docs/_fragments/insecure_hash_warning.rst +0 -9
  180. passlib-1.7.3/docs/_fragments/trivial_hash_warning.rst +0 -8
  181. passlib-1.7.3/docs/_static/bb-logo.png +0 -0
  182. passlib-1.7.3/docs/_static/bb-logo.png.orig +0 -0
  183. passlib-1.7.3/docs/_static/bb-logo.svg +0 -929
  184. passlib-1.7.3/docs/_static/bb-logo.svg.orig +0 -927
  185. passlib-1.7.3/docs/_static/logo-128.png +0 -0
  186. passlib-1.7.3/docs/_static/logo-64.png +0 -0
  187. passlib-1.7.3/docs/_static/logo.png +0 -0
  188. passlib-1.7.3/docs/_static/logo.svg +0 -297
  189. passlib-1.7.3/docs/_static/masthead.svg +0 -413
  190. passlib-1.7.3/docs/conf.py +0 -352
  191. passlib-1.7.3/docs/contents.rst +0 -14
  192. passlib-1.7.3/docs/copyright.rst +0 -1
  193. passlib-1.7.3/docs/dev-requirements.txt +0 -1
  194. passlib-1.7.3/docs/history/1.5.rst +0 -173
  195. passlib-1.7.3/docs/history/1.6.rst +0 -400
  196. passlib-1.7.3/docs/history/1.7.rst +0 -517
  197. passlib-1.7.3/docs/history/ancient.rst +0 -126
  198. passlib-1.7.3/docs/history/index.rst +0 -47
  199. passlib-1.7.3/docs/history.rst +0 -8
  200. passlib-1.7.3/docs/index.rst +0 -108
  201. passlib-1.7.3/docs/install.rst +0 -167
  202. passlib-1.7.3/docs/lib/index.rst +0 -55
  203. passlib-1.7.3/docs/lib/passlib.apache.rst +0 -82
  204. passlib-1.7.3/docs/lib/passlib.apps.rst +0 -255
  205. passlib-1.7.3/docs/lib/passlib.context-tutorial.rst +0 -8
  206. passlib-1.7.3/docs/lib/passlib.context.rst +0 -545
  207. passlib-1.7.3/docs/lib/passlib.crypto.des.rst +0 -26
  208. passlib-1.7.3/docs/lib/passlib.crypto.digest.rst +0 -48
  209. passlib-1.7.3/docs/lib/passlib.crypto.rst +0 -18
  210. passlib-1.7.3/docs/lib/passlib.exc.rst +0 -49
  211. passlib-1.7.3/docs/lib/passlib.ext.django.rst +0 -195
  212. passlib-1.7.3/docs/lib/passlib.hash.apr_md5_crypt.rst +0 -45
  213. passlib-1.7.3/docs/lib/passlib.hash.argon2.rst +0 -127
  214. passlib-1.7.3/docs/lib/passlib.hash.atlassian_pbkdf2_sha1.rst +0 -58
  215. passlib-1.7.3/docs/lib/passlib.hash.bcrypt.rst +0 -239
  216. passlib-1.7.3/docs/lib/passlib.hash.bcrypt_sha256.rst +0 -83
  217. passlib-1.7.3/docs/lib/passlib.hash.bigcrypt.rst +0 -149
  218. passlib-1.7.3/docs/lib/passlib.hash.cisco_asa.rst +0 -20
  219. passlib-1.7.3/docs/lib/passlib.hash.cisco_pix.rst +0 -205
  220. passlib-1.7.3/docs/lib/passlib.hash.cta_pbkdf2_sha1.rst +0 -61
  221. passlib-1.7.3/docs/lib/passlib.hash.django_std.rst +0 -268
  222. passlib-1.7.3/docs/lib/passlib.hash.dlitz_pbkdf2_sha1.rst +0 -76
  223. passlib-1.7.3/docs/lib/passlib.hash.fshp.rst +0 -123
  224. passlib-1.7.3/docs/lib/passlib.hash.grub_pbkdf2_sha512.rst +0 -80
  225. passlib-1.7.3/docs/lib/passlib.hash.hex_digests.rst +0 -65
  226. passlib-1.7.3/docs/lib/passlib.hash.ldap_crypt.rst +0 -65
  227. passlib-1.7.3/docs/lib/passlib.hash.ldap_other.rst +0 -51
  228. passlib-1.7.3/docs/lib/passlib.hash.ldap_pbkdf2_digest.rst +0 -38
  229. passlib-1.7.3/docs/lib/passlib.hash.ldap_std.rst +0 -127
  230. passlib-1.7.3/docs/lib/passlib.hash.msdcc.rst +0 -95
  231. passlib-1.7.3/docs/lib/passlib.hash.msdcc2.rst +0 -106
  232. passlib-1.7.3/docs/lib/passlib.hash.mssql2000.rst +0 -94
  233. passlib-1.7.3/docs/lib/passlib.hash.mssql2005.rst +0 -83
  234. passlib-1.7.3/docs/lib/passlib.hash.mysql323.rst +0 -65
  235. passlib-1.7.3/docs/lib/passlib.hash.mysql41.rst +0 -46
  236. passlib-1.7.3/docs/lib/passlib.hash.nthash.rst +0 -77
  237. passlib-1.7.3/docs/lib/passlib.hash.oracle10.rst +0 -113
  238. passlib-1.7.3/docs/lib/passlib.hash.oracle11.rst +0 -78
  239. passlib-1.7.3/docs/lib/passlib.hash.pbkdf2_digest.rst +0 -110
  240. passlib-1.7.3/docs/lib/passlib.hash.phpass.rst +0 -76
  241. passlib-1.7.3/docs/lib/passlib.hash.plaintext.rst +0 -34
  242. passlib-1.7.3/docs/lib/passlib.hash.postgres_md5.rst +0 -69
  243. passlib-1.7.3/docs/lib/passlib.hash.rst +0 -323
  244. passlib-1.7.3/docs/lib/passlib.hash.scram.rst +0 -171
  245. passlib-1.7.3/docs/lib/passlib.hash.scrypt.rst +0 -128
  246. passlib-1.7.3/docs/lib/passlib.hash.sha1_crypt.rst +0 -117
  247. passlib-1.7.3/docs/lib/passlib.hash.sha512_crypt.rst +0 -46
  248. passlib-1.7.3/docs/lib/passlib.hash.sun_md5_crypt.rst +0 -195
  249. passlib-1.7.3/docs/lib/passlib.hash.unix_disabled.rst +0 -47
  250. passlib-1.7.3/docs/lib/passlib.hosts.rst +0 -135
  251. passlib-1.7.3/docs/lib/passlib.ifc.rst +0 -719
  252. passlib-1.7.3/docs/lib/passlib.pwd.rst +0 -52
  253. passlib-1.7.3/docs/lib/passlib.registry.rst +0 -71
  254. passlib-1.7.3/docs/lib/passlib.totp.rst +0 -189
  255. passlib-1.7.3/docs/lib/passlib.utils.binary.rst +0 -89
  256. passlib-1.7.3/docs/lib/passlib.utils.compat.rst +0 -61
  257. passlib-1.7.3/docs/lib/passlib.utils.des.rst +0 -20
  258. passlib-1.7.3/docs/lib/passlib.utils.handlers.rst +0 -211
  259. passlib-1.7.3/docs/lib/passlib.utils.pbkdf2.rst +0 -37
  260. passlib-1.7.3/docs/lib/passlib.utils.rst +0 -155
  261. passlib-1.7.3/docs/modular_crypt_format.rst +0 -234
  262. passlib-1.7.3/docs/narr/context-tutorial.rst +0 -550
  263. passlib-1.7.3/docs/narr/hash-tutorial.rst +0 -327
  264. passlib-1.7.3/docs/narr/index.rst +0 -30
  265. passlib-1.7.3/docs/narr/overview.rst +0 -92
  266. passlib-1.7.3/docs/narr/quickstart.rst +0 -297
  267. passlib-1.7.3/docs/narr/totp-tutorial.rst +0 -772
  268. passlib-1.7.3/docs/new_app_quickstart.rst +0 -8
  269. passlib-1.7.3/docs/other.rst +0 -14
  270. passlib-1.7.3/docs/overview.rst +0 -8
  271. passlib-1.7.3/docs/password_hash_api.rst +0 -8
  272. passlib-1.7.3/docs/requirements.txt +0 -2
  273. passlib-1.7.3/passlib/_setup/__init__.py +0 -1
  274. passlib-1.7.3/passlib/_setup/stamp.py +0 -149
  275. passlib-1.7.3/passlib/apps.py +0 -205
  276. passlib-1.7.3/passlib/crypto/_blowfish/_gen_files.py +0 -204
  277. passlib-1.7.3/passlib/crypto/_blowfish/base.py +0 -441
  278. passlib-1.7.3/passlib/crypto/_blowfish/unrolled.py +0 -771
  279. passlib-1.7.3/passlib/crypto/_md4.py +0 -244
  280. passlib-1.7.3/passlib/crypto/des.py +0 -848
  281. passlib-1.7.3/passlib/crypto/scrypt/_gen_files.py +0 -154
  282. passlib-1.7.3/passlib/crypto/scrypt/_salsa.py +0 -170
  283. passlib-1.7.3/passlib/ext/django/models.py +0 -36
  284. passlib-1.7.3/passlib/handlers/mysql.py +0 -128
  285. passlib-1.7.3/passlib/handlers/postgres.py +0 -55
  286. passlib-1.7.3/passlib/handlers/roundup.py +0 -29
  287. passlib-1.7.3/passlib/handlers/sha1_crypt.py +0 -158
  288. passlib-1.7.3/passlib/hosts.py +0 -106
  289. passlib-1.7.3/passlib/tests/__main__.py +0 -6
  290. passlib-1.7.3/passlib/tests/backports.py +0 -67
  291. passlib-1.7.3/passlib/tests/test_apache.py +0 -769
  292. passlib-1.7.3/passlib/tests/test_apps.py +0 -139
  293. passlib-1.7.3/passlib/tests/test_context.py +0 -1796
  294. passlib-1.7.3/passlib/tests/test_context_deprecated.py +0 -743
  295. passlib-1.7.3/passlib/tests/test_crypto_digest.py +0 -544
  296. passlib-1.7.3/passlib/tests/test_ext_django.py +0 -843
  297. passlib-1.7.3/passlib/tests/test_ext_django_source.py +0 -250
  298. passlib-1.7.3/passlib/tests/test_handlers.py +0 -1819
  299. passlib-1.7.3/passlib/tests/test_handlers_argon2.py +0 -507
  300. passlib-1.7.3/passlib/tests/test_handlers_bcrypt.py +0 -688
  301. passlib-1.7.3/passlib/tests/test_handlers_cisco.py +0 -457
  302. passlib-1.7.3/passlib/tests/test_handlers_pbkdf2.py +0 -480
  303. passlib-1.7.3/passlib/tests/test_handlers_scrypt.py +0 -111
  304. passlib-1.7.3/passlib/tests/test_hosts.py +0 -97
  305. passlib-1.7.3/passlib/tests/test_registry.py +0 -228
  306. passlib-1.7.3/passlib/tests/test_totp.py +0 -1604
  307. passlib-1.7.3/passlib/tests/test_utils.py +0 -1171
  308. passlib-1.7.3/passlib/tests/test_utils_handlers.py +0 -870
  309. passlib-1.7.3/passlib/tests/test_utils_md4.py +0 -41
  310. passlib-1.7.3/passlib/tests/test_utils_pbkdf2.py +0 -323
  311. passlib-1.7.3/passlib/tests/test_win32.py +0 -50
  312. passlib-1.7.3/passlib/tests/tox_support.py +0 -83
  313. passlib-1.7.3/passlib/utils/__init__.py +0 -1220
  314. passlib-1.7.3/passlib/utils/compat/__init__.py +0 -474
  315. passlib-1.7.3/passlib/utils/compat/_ordered_dict.py +0 -242
  316. passlib-1.7.3/passlib/utils/des.py +0 -46
  317. passlib-1.7.3/passlib/utils/md4.py +0 -29
  318. passlib-1.7.3/passlib/win32.py +0 -68
  319. passlib-1.7.3/passlib.egg-info/PKG-INFO +0 -58
  320. passlib-1.7.3/passlib.egg-info/SOURCES.txt +0 -220
  321. passlib-1.7.3/passlib.egg-info/dependency_links.txt +0 -1
  322. passlib-1.7.3/passlib.egg-info/requires.txt +0 -14
  323. passlib-1.7.3/passlib.egg-info/top_level.txt +0 -1
  324. passlib-1.7.3/passlib.egg-info/zip-safe +0 -1
  325. passlib-1.7.3/setup.cfg +0 -13
  326. passlib-1.7.3/setup.py +0 -197
  327. passlib-1.7.3/tox.ini +0 -210
  328. {passlib-1.7.3 → passlib-1.9.5}/LICENSE +0 -0
  329. {passlib-1.7.3/docs/_static → passlib-1.9.5/docs/assets}/logo.ico +0 -0
  330. {passlib-1.7.3/docs/_static → passlib-1.9.5/docs/assets}/masthead.png +0 -0
  331. {passlib-1.7.3 → passlib-1.9.5}/passlib/_data/wordsets/bip39.txt +0 -0
  332. {passlib-1.7.3 → passlib-1.9.5}/passlib/_data/wordsets/eff_long.txt +0 -0
  333. {passlib-1.7.3 → passlib-1.9.5}/passlib/_data/wordsets/eff_prefixed.txt +0 -0
  334. {passlib-1.7.3 → passlib-1.9.5}/passlib/_data/wordsets/eff_short.txt +0 -0
  335. {passlib-1.7.3 → passlib-1.9.5}/passlib/crypto/__init__.py +0 -0
  336. {passlib-1.7.3 → passlib-1.9.5}/passlib/ext/__init__.py +0 -0
  337. {passlib-1.7.3 → passlib-1.9.5}/passlib/ext/django/__init__.py +0 -0
  338. {passlib-1.7.3 → passlib-1.9.5}/passlib/handlers/__init__.py +0 -0
  339. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/__init__.py +0 -0
  340. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/sample1.cfg +0 -0
  341. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/sample1c.cfg +0 -0
  342. {passlib-1.7.3/passlib → passlib-1.9.5}/tests/sample_config_1s.cfg +0 -0
@@ -0,0 +1,16 @@
1
+ .idea
2
+
3
+ .pdm-python
4
+
5
+ __pycache__
6
+
7
+ .coverage
8
+ .coverage.*
9
+ coverage.xml
10
+
11
+ dist
12
+
13
+ *.pyc
14
+
15
+ # ProperDocs
16
+ site
@@ -0,0 +1,125 @@
1
+ ## 1.9.5 (2026-11-23)
2
+
3
+ ## 1.9.4 (2026-10-17)
4
+
5
+ ### Fix
6
+
7
+ - Fixes regression in backend logic for `argon2` and `bcrypt`
8
+
9
+ ## 1.9.3 (2025-10-09)
10
+ ## Fix
11
+ - Improve bcrypt version detection by @chapmajs
12
+
13
+ ## Build
14
+ - Unpin bcrypt
15
+
16
+ ## 1.9.2 (2025-10-01)
17
+
18
+ ### Build
19
+ - pin bcrypt to `<5.0.0`
20
+
21
+ ## 1.9.1.post0 (2025-05-17)
22
+
23
+ ## 1.9.1 (2025-05-02)
24
+
25
+ ### Fix
26
+
27
+ - don't use root logger
28
+
29
+ ### Refactor
30
+
31
+ - **apache**: improve typing of HtpasswdFile and HtdigestFile
32
+ - enable ruff "INP" rule
33
+ - enable ruff "PLW" rule
34
+ - enable ruff "PLC" rule
35
+
36
+ ## 1.9.0 (2025-02-18)
37
+
38
+ ### Refactor
39
+
40
+ - remove dependency on crypt
41
+
42
+ ## 1.8.2 (2025-02-13)
43
+
44
+ ### Fix
45
+ - add python 3.13 compatability
46
+
47
+ ### Refactor
48
+
49
+ - enable ruff "FURB" rule
50
+ - enable ruff "PERF" rule
51
+ - enable ruff "RSE" rule
52
+ - enable ruff "FA" rule
53
+ - enable ruff "ISC" rule
54
+ - enable ruff "SIM" rule
55
+ - enable ruff "PIE" rule
56
+ - enable ruff "G" rule
57
+ - enable RET ruff rule
58
+ - enable pyupgrade(UP) checks in ruff
59
+ - **tests/**: use pytest to capture warnings
60
+ - **utils**: improve typing
61
+ - remove jython and pypy compatiblity helpers, remove setup.py
62
+ - remove dependency on built-in crypt, use legacycrypt instead
63
+ - replace consteq and str_consteq implementations with hmac.compare_digest
64
+
65
+ ## 1.7.5.post0 (2024-09-11)
66
+
67
+ ## 1.7.5 (2024-09-11)
68
+
69
+ ### Fix
70
+
71
+ - **argon2.py**: use metadata.version to retrieve package version
72
+ - **bcrypt.py**: use importlib.metadata to get bcrypt version
73
+ - **bcrypt.py**: _calc_checksum call
74
+
75
+ ### Refactor
76
+
77
+ - fix some of ruff errors
78
+ - remove deprecated pkg_resources usage
79
+ - add ".git-blame-ignore-revs"
80
+ - add ruff, mypy and deptry
81
+ - cleanup
82
+ - use pdm for dependency management
83
+
84
+ ## 1.7.4 (2020-10-08)
85
+
86
+ ## 1.7.3 (2020-10-06)
87
+
88
+ ## 1.7.2 (2019-11-22)
89
+
90
+ ## 1.7.1 (2017-01-30)
91
+
92
+ ## 1.7.0 (2016-11-22)
93
+
94
+ ### Fix
95
+
96
+ - passlib.tests: added "test_handlers_argon2" to get_handler_case()
97
+ - handler test suite: avoid even rounds for bsdi_crypt
98
+
99
+ ## 1.6.5 (2015-08-04)
100
+
101
+ ## 1.6.4 (2015-07-25)
102
+
103
+ ## 1.6.2 (2013-12-26)
104
+
105
+ ## 1.6.1 (2012-08-02)
106
+
107
+ ## 1.6 (2012-05-17)
108
+
109
+ ## 1.5.3 (2011-10-08)
110
+
111
+ ## 1.5.2 (2011-09-19)
112
+
113
+ ## 1.5.1 (2011-08-17)
114
+
115
+ ## 1.5 (2011-07-11)
116
+
117
+ ## 1.4 (2011-05-04)
118
+
119
+ ## 1.3.1 (2011-03-28)
120
+
121
+ ## 1.3.0 (2011-03-25)
122
+
123
+ ## 1.2.0 (2011-01-17)
124
+
125
+ ## 1.1.0 (2011-01-07)
passlib-1.9.5/PKG-INFO ADDED
@@ -0,0 +1,90 @@
1
+ Metadata-Version: 2.5
2
+ Name: passlib
3
+ Version: 1.9.5
4
+ Summary: Comprehensive password hashing framework supporting over 30 schemes
5
+ Project-URL: Homepage, https://github.com/notypecheck/passlib
6
+ Project-URL: Repository, https://github.com/notypecheck/passlib
7
+ Project-URL: Docs, https://notypecheck.github.io/passlib/
8
+ Project-URL: Issues, https://github.com/notypecheck/passlib/issues
9
+ Project-URL: Changelog, https://github.com/notypecheck/passlib/blob/main/CHANGELOG.md
10
+ Author-email: Eli Collins <elic@assurancetechnologies.com>
11
+ Maintainer-email: Noel <notypecheck@gmail.com>
12
+ License-Expression: BSD-3-Clause
13
+ License-File: LICENSE
14
+ Keywords: 2fa,apache,argon2,bcrypt,crypt,hash,htdigest,htpasswd,md5-crypt,passlib,password,pbkdf2,scrypt,secret,security,sha256-crypt,sha512-crypt,totp
15
+ Classifier: Development Status :: 5 - Production/Stable
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Natural Language :: English
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Programming Language :: Python :: 3.15
25
+ Classifier: Programming Language :: Python :: Implementation :: CPython
26
+ Classifier: Topic :: Security :: Cryptography
27
+ Classifier: Topic :: Software Development :: Libraries
28
+ Requires-Python: >=3.11
29
+ Provides-Extra: argon2
30
+ Requires-Dist: argon2-cffi>=18.2.0; extra == 'argon2'
31
+ Provides-Extra: bcrypt
32
+ Requires-Dist: bcrypt>=3.1.0; extra == 'bcrypt'
33
+ Provides-Extra: totp
34
+ Requires-Dist: cryptography>=43.0.1; extra == 'totp'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # Passlib
38
+
39
+ ![PyPI Version](https://img.shields.io/pypi/v/passlib?style=for-the-badge)
40
+ ![PyPI Python Version](https://img.shields.io/pypi/pyversions/passlib?style=for-the-badge)
41
+
42
+
43
+ This is the official repository of Passlib, published on PyPI as
44
+ [passlib](https://pypi.org/project/passlib/). It continues the original
45
+ project at https://foss.heptapod.net/python-libs/passlib (unmaintained since
46
+ its final release, 1.7.4, in 2020).
47
+
48
+ Passlib is a password hashing library for Python 3, which provides
49
+ cross-platform implementations of over 30 password hashing algorithms, as well
50
+ as a framework for managing existing password hashes. It's designed to be useful
51
+ for a wide range of tasks, from verifying a hash found in /etc/shadow, to
52
+ providing full-strength password hashing for multi-user application.
53
+
54
+ Versions 1.7.5 through 1.9.4 were published on PyPI as
55
+ [libpass](https://pypi.org/project/libpass/); releases from 1.9.5 onward
56
+ are published under `passlib` again.
57
+
58
+ - See the [documentation](https://notypecheck.github.io/passlib/)
59
+ for details, installation instructions, and examples.
60
+ - See the [changelog](https://github.com/notypecheck/passlib/blob/main/CHANGELOG.md)
61
+ for a description of what's new in Passlib.
62
+ - Visit [PyPI](https://pypi.org/project/passlib/) for the latest stable release.
63
+
64
+ ## Installation
65
+ ```shell
66
+ pip install passlib
67
+ ```
68
+
69
+ Available extras:
70
+ ```shell
71
+ pip install passlib[argon2]
72
+ pip install passlib[bcrypt]
73
+ pip install passlib[totp]
74
+ ```
75
+
76
+ ## Usage
77
+ A quick example of using passlib to integrate into a new application:
78
+ ```python
79
+ from passlib.context import CryptContext
80
+
81
+ context = CryptContext(schemes=["sha512_crypt"])
82
+
83
+ hash = context.hash("password")
84
+ # $6$rounds=656000$jFKvvPmUywlqjSs.$iNeK/OWVry7KThNyzR01xzqZzgk/VA75.sR4yXXblsPAoEugtdO3zn/O4VEG3Izp8l5.//lMGpuRCOqvKknHo1
85
+
86
+ # Verifying a password
87
+ is_valid = context.verify("password", hash)
88
+ # > True
89
+ ```
90
+ For more details and an extended set of examples, see the [full documentation](https://notypecheck.github.io/passlib/)
@@ -0,0 +1,54 @@
1
+ # Passlib
2
+
3
+ ![PyPI Version](https://img.shields.io/pypi/v/passlib?style=for-the-badge)
4
+ ![PyPI Python Version](https://img.shields.io/pypi/pyversions/passlib?style=for-the-badge)
5
+
6
+
7
+ This is the official repository of Passlib, published on PyPI as
8
+ [passlib](https://pypi.org/project/passlib/). It continues the original
9
+ project at https://foss.heptapod.net/python-libs/passlib (unmaintained since
10
+ its final release, 1.7.4, in 2020).
11
+
12
+ Passlib is a password hashing library for Python 3, which provides
13
+ cross-platform implementations of over 30 password hashing algorithms, as well
14
+ as a framework for managing existing password hashes. It's designed to be useful
15
+ for a wide range of tasks, from verifying a hash found in /etc/shadow, to
16
+ providing full-strength password hashing for multi-user application.
17
+
18
+ Versions 1.7.5 through 1.9.4 were published on PyPI as
19
+ [libpass](https://pypi.org/project/libpass/); releases from 1.9.5 onward
20
+ are published under `passlib` again.
21
+
22
+ - See the [documentation](https://notypecheck.github.io/passlib/)
23
+ for details, installation instructions, and examples.
24
+ - See the [changelog](https://github.com/notypecheck/passlib/blob/main/CHANGELOG.md)
25
+ for a description of what's new in Passlib.
26
+ - Visit [PyPI](https://pypi.org/project/passlib/) for the latest stable release.
27
+
28
+ ## Installation
29
+ ```shell
30
+ pip install passlib
31
+ ```
32
+
33
+ Available extras:
34
+ ```shell
35
+ pip install passlib[argon2]
36
+ pip install passlib[bcrypt]
37
+ pip install passlib[totp]
38
+ ```
39
+
40
+ ## Usage
41
+ A quick example of using passlib to integrate into a new application:
42
+ ```python
43
+ from passlib.context import CryptContext
44
+
45
+ context = CryptContext(schemes=["sha512_crypt"])
46
+
47
+ hash = context.hash("password")
48
+ # $6$rounds=656000$jFKvvPmUywlqjSs.$iNeK/OWVry7KThNyzR01xzqZzgk/VA75.sR4yXXblsPAoEugtdO3zn/O4VEG3Izp8l5.//lMGpuRCOqvKknHo1
49
+
50
+ # Verifying a password
51
+ is_valid = context.verify("password", hash)
52
+ # > True
53
+ ```
54
+ For more details and an extended set of examples, see the [full documentation](https://notypecheck.github.io/passlib/)
@@ -0,0 +1,54 @@
1
+ version: "3"
2
+
3
+ vars:
4
+ RUNNER:
5
+ sh: 'echo {{ .RUNNER | default "uv run " }}'
6
+ SOURCES: .
7
+ SOURCES_ROOT: .
8
+
9
+ tasks:
10
+ default:
11
+ cmd:
12
+ task: all
13
+
14
+ lint:
15
+ desc: Lint python source files
16
+ cmds:
17
+ - "{{.RUNNER}} ruff check {{.SOURCES}}"
18
+ - "{{.RUNNER}} ruff format --check --diff {{.SOURCES}}"
19
+
20
+ format:
21
+ desc: Format python source files
22
+ aliases: ["fmt"]
23
+ cmds:
24
+ - "{{.RUNNER}} ruff format {{ .SOURCES }}"
25
+ - "{{.RUNNER}} ruff check --fix {{.SOURCES}}"
26
+
27
+ deptry:
28
+ desc: Check used dependencies with deptry
29
+ cmd: "{{.RUNNER}} deptry {{.SOURCES_ROOT}}"
30
+
31
+ typecheck:
32
+ desc: Perform type-checking
33
+ cmd: "{{.RUNNER}} mypy {{.SOURCES}}"
34
+
35
+ docs:
36
+ desc: Serve documentation locally
37
+ cmd: "{{.RUNNER}} properdocs serve --dirty --no-strict"
38
+
39
+ docs-build:
40
+ desc: Build documentation
41
+ cmd: "{{.RUNNER}} properdocs build"
42
+
43
+ test:
44
+ desc: Run tests
45
+ cmds:
46
+ - "{{.RUNNER}} pytest -n auto --cov"
47
+
48
+ all:
49
+ desc: Run the standard set of checks performed in CI
50
+ cmds:
51
+ - task: format
52
+ - task: deptry
53
+ - task: typecheck
54
+ - task: test
@@ -0,0 +1,43 @@
1
+ # API Reference
2
+
3
+ The reference section contains documentation of Passlib's public API.
4
+ These chapters are focused on providing detailed reference of the individual
5
+ functions and classes; they will generally be cross-linked to any related walkthrough
6
+ documentation (which tries to provide a higher-level synthetic view).
7
+
8
+ !!! note
9
+ **Primary modules:**
10
+
11
+ The primary modules that will be of interest are:
12
+
13
+ - `passlib.hash`
14
+ - `passlib.context`
15
+ - `passlib.totp`
16
+ - `passlib.exc`
17
+
18
+ !!! caution
19
+ **Internal modules:**
20
+
21
+ The following modules are mainly used internally,
22
+ may change structure between releases,
23
+ and are documented mainly for completeness:
24
+
25
+ - `passlib.crypto`
26
+ - `passlib.registry`
27
+ - `passlib.utils`
28
+
29
+ **Alphabetical module list:**
30
+
31
+ - [`passlib.apache`](passlib.apache.md)
32
+ - [`passlib.apps`](passlib.apps.md)
33
+ - [`passlib.context`](passlib.context.md)
34
+ - [`passlib.crypto`](passlib.crypto.md)
35
+ - [`passlib.exc`](passlib.exc.md)
36
+ - [`passlib.ext.django`](passlib.ext.django.md)
37
+ - [`passlib.hash`](passlib.hash.md)
38
+ - [`passlib.hosts`](passlib.hosts.md)
39
+ - [`passlib.ifc`](passlib.ifc.md)
40
+ - [`passlib.pwd`](passlib.pwd.md)
41
+ - [`passlib.registry`](passlib.registry.md)
42
+ - [`passlib.totp`](passlib.totp.md)
43
+ - [`passlib.utils`](passlib.utils.md)
@@ -0,0 +1,71 @@
1
+ # `passlib.apache` - Apache Password Files
2
+
3
+ This module provides utilities for reading and writing Apache's htpasswd and htdigest files, through the use of two helper classes.
4
+
5
+ !!! warning
6
+ Changed in 1.6: The api for this module was updated to be more flexible, and to have less ambiguous method names. The old method and keyword names are deprecated, and will be removed in Passlib 1.8.
7
+
8
+ !!! warning
9
+ Changed in 1.7: These classes will now preserve blank lines and "#" comments when updating htpasswd files; previous releases would throw a parse error.
10
+
11
+ !!! warning
12
+ Changed in 1.8: A number of methods deprecated since 1.6, have been removed.
13
+
14
+ ## Htpasswd Files
15
+
16
+ The `HtpasswdFile` class allows managing of htpasswd files.
17
+ A quick summary of its usage:
18
+
19
+ ```python
20
+ from passlib.apache import HtpasswdFile
21
+
22
+ # when creating a new file, set to new=True, add entries, and save.
23
+ ht = HtpasswdFile("test.htpasswd", new=True)
24
+ ht.set_password("someuser", "really secret password")
25
+ ht.save()
26
+
27
+ # loading an existing file to update a password
28
+ ht = HtpasswdFile("test.htpasswd")
29
+ ht.set_password("someuser", "new secret password")
30
+ ht.save()
31
+
32
+ # examining file, verifying user's password
33
+ ht = HtpasswdFile("test.htpasswd")
34
+ print(ht.users())
35
+ # > ["someuser"]
36
+ print(ht.check_password("someuser", "wrong password"))
37
+ # > False
38
+ print(ht.check_password("someuser", "new secret password"))
39
+ # > True
40
+
41
+ # making in-memory changes and exporting to string
42
+ ht = HtpasswdFile()
43
+ ht.set_password("someuser", "mypass")
44
+ ht.set_password("someuser", "anotherpass")
45
+ s = ht.to_string()
46
+ print(s)
47
+ # > someuser:$apr1$T4f7D9ly$EobZDROnHblCNPCtrgh5i/
48
+ # > anotheruser:$apr1$vBdPWvh1$GrhfbyGvN/7HalW5cS9XB1
49
+ ```
50
+
51
+ !!! warning
52
+ `HtpasswdFile` currently defaults to using [`apr_md5_crypt`](passlib.hash.apr_md5_crypt.md),
53
+ as this is the only htpasswd hash guaranteed to be portable across operating systems.
54
+ However, for security reasons Passlib 1.7 will default to using the strongest algorithm
55
+ available on the host platform (e.g. [`bcrypt`](passlib.hash.bcrypt.md) or [`sha256_crypt`](passlib.hash.sha256_crypt.md)).
56
+ Applications that are relying on the old behavior should specify
57
+ `HtpasswdFile(default_scheme="portable")` (new in Passlib 1.6.3).
58
+
59
+ ::: passlib.apache.HtpasswdFile
60
+
61
+ ## Htdigest Files
62
+
63
+ The `HtdigestFile` class allows management of htdigest files
64
+ in a similar fashion to [`HtpasswdFile`](passlib.apache.md#htpasswd-files).
65
+
66
+ ::: passlib.apache.HtdigestFile
67
+
68
+ ## References
69
+
70
+ - Htpasswd Manual - <http://httpd.apache.org/docs/current/programs/htpasswd.html>
71
+ - Apache Auth Configuration - <http://httpd.apache.org/docs/current/howto/auth.html>
@@ -0,0 +1,235 @@
1
+ # `passlib.apps` - Helpers for various applications
2
+
3
+ This module contains a number of preconfigured [`CryptContext`](passlib.context.md) instances that are provided by Passlib for easily handling the hash formats used by various applications.
4
+
5
+ ## Usage Example
6
+
7
+ The `CryptContext` class itself has a large number of features,
8
+ but to give an example of how to quickly use the instances in this module:
9
+
10
+ Each of the objects in this module can be imported directly:
11
+
12
+ ```python
13
+ # as an example, this imports the custom_app_context object,
14
+ # a helper to let new applications *quickly* add password hashing.
15
+ from passlib.apps import custom_app_context
16
+ ```
17
+
18
+ Hashing a password is simple (and salt generation is handled automatically):
19
+
20
+ ```python
21
+ hash = custom_app_context.hash("toomanysecrets")
22
+ print(hash)
23
+ # > $5$rounds=84740$fYChCy.52EzebF51$9bnJrmTf2FESI93hgIBFF4qAfysQcKoB0veiI0ZeYU4
24
+ ```
25
+
26
+ Verifying a password against an existing hash is just as quick:
27
+
28
+ ```python
29
+ print(custom_app_context.verify("toomanysocks", hash))
30
+ # > False
31
+ print(custom_app_context.verify("toomanysecrets", hash))
32
+ # > True
33
+ ```
34
+
35
+ !!! tip
36
+ See the [`CryptContext Tutorial`](../guide/context-tutorial.md) and [`CryptContext Reference`](passlib.context.md) for more information about the CryptContext class.
37
+
38
+ ## Django
39
+
40
+ The following objects provide pre-configured `CryptContext` instances
41
+ for handling [Django](http://www.djangoproject.com) password hashes, as used by Django's `django.contrib.auth` module.
42
+ They recognize all the [builtin Django hashes](passlib.hash.django_std.md) supported by the particular Django version.
43
+
44
+ !!! note
45
+ These objects may not match the hashes in your database if a third-party
46
+ library has been used to patch Django to support alternate hash formats.
47
+ This includes the [django-bcrypt](http://pypi.python.org/pypi/django-bcrypt)
48
+ plugin, or Passlib's builtin [`passlib.ext.django`](passlib.ext.django.md).
49
+ As well, Django 1.4 introduced a very configurable "hashers" framework,
50
+ and individual deployments may support additional hashes and/or
51
+ have other defaults.
52
+
53
+ `django10_context`
54
+
55
+ The object replicates the password hashing policy for Django 1.0-1.3.
56
+ It supports all the Django 1.0 hashes, and defaults to
57
+ [`django_salted_sha1`](passlib.hash.django_std.md).
58
+
59
+ !!! warning
60
+ Added in 1.6.
61
+
62
+ `django14_context`
63
+
64
+ The object replicates the stock password hashing policy for Django 1.4.
65
+ It supports all the Django 1.0 & 1.4 hashes, and defaults to
66
+ [`django_pbkdf2_sha256`](passlib.hash.django_std.md). It treats all
67
+ Django 1.0 hashes as deprecated.
68
+
69
+ !!! warning
70
+ Added in 1.6.
71
+
72
+ `django16_context`
73
+
74
+ The object replicates the stock password hashing policy for Django 1.6.
75
+ It supports all the Django 1.0-1.6 hashes, and defaults to
76
+ [`django_pbkdf2_sha256`](passlib.hash.django_std.md). It treats all
77
+ Django 1.0 hashes as deprecated.
78
+
79
+ !!! warning
80
+ Added in 1.6.2.
81
+
82
+ `django_context`
83
+
84
+ This alias will always point to the latest preconfigured Django
85
+ context supported by Passlib, and as such should support
86
+ all historical hashes built into Django.
87
+
88
+ !!! warning
89
+ Changed in 1.6.2: This now points to `django16_context`.
90
+
91
+ ## LDAP
92
+
93
+ Passlib provides two contexts related to ldap hashes:
94
+
95
+ `ldap_context`
96
+
97
+ This object provides a pre-configured `CryptContext` instance
98
+ for handling LDAPv2 password hashes. It recognizes all
99
+ the [standard ldap hashes](passlib.hash.ldap_std.md).
100
+
101
+ It defaults to using the `{SSHA}` password hash.
102
+ For times when there should be another default, using code such as the following:
103
+
104
+ ```python
105
+ from passlib.apps import ldap_context
106
+
107
+ ldap_context = ldap_context.replace(default="ldap_salted_md5")
108
+
109
+ # the new context object will now default to {SMD5}:
110
+ print(ldap_context.hash("password"))
111
+ # > '{SMD5}T9f89F591P3fFh1jz/YtW4aWD5s='
112
+ ```
113
+
114
+ `ldap_nocrypt_context`
115
+
116
+ This object recognizes all the standard ldap schemes that `ldap_context`
117
+ does, *except* for the `{CRYPT}`-based schemes.
118
+
119
+ ## MySQL
120
+
121
+ This module provides two pre-configured `CryptContext` instances
122
+ for handling MySQL user passwords:
123
+
124
+ `mysql_context`
125
+
126
+ This object should recognize the new [`mysql41`](passlib.hash.mysql41.md) hashes,
127
+ as well as any legacy [`mysql323`](passlib.hash.mysql323.md) hashes.
128
+
129
+ It defaults to mysql41 when generating new hashes.
130
+
131
+ This should be used with MySQL version 4.1 and newer.
132
+
133
+ `mysql3_context`
134
+
135
+ This object is for use with older MySQL deploys which only recognize
136
+ the [`mysql323`](passlib.hash.mysql323.md) hash.
137
+
138
+ This should be used only with MySQL version 3.2.3 - 4.0.
139
+
140
+ ## PHPass
141
+
142
+ [PHPass](http://www.openwall.com/phpass/) is a PHP password hashing library,
143
+ and hashes derived from it are found in a number of PHP applications.
144
+ It is found in a wide range of PHP applications, including Drupal and Wordpress.
145
+
146
+ `phpass_context`
147
+
148
+ This object follows the standard PHPass logic:
149
+ it supports [`bcrypt`](passlib.hash.bcrypt.md), [`bsdi_crypt`](passlib.hash.bsdi_crypt.md),
150
+ and implements a custom scheme called the "phpass portable hash" [`phpass`](passlib.hash.phpass.md) as a fallback.
151
+
152
+ BCrypt is used as the default if support is available,
153
+ otherwise the Portable Hash will be used as the default.
154
+
155
+ !!! warning
156
+ Changed in 1.5: Now uses Portable Hash as fallback if BCrypt isn't available. Previously used BSDI-Crypt as fallback (per original PHPass implementation), but it was decided PHPass is in fact more secure.
157
+
158
+ `phpbb3_context`
159
+
160
+ This object supports phpbb3 password hashes, which use a variant of [`phpass`](passlib.hash.phpass.md).
161
+
162
+ ## PostgreSQL
163
+
164
+ `postgres_context`
165
+
166
+ This object should recognize password hashes stored in PostgreSQL's `pg_shadow` table,
167
+ which are all assumed to follow the [`postgres_md5`](passlib.hash.postgres_md5.md) format.
168
+
169
+ Note that the username must be provided whenever hashing or verifying a postgres hash:
170
+
171
+ ```python
172
+ from passlib.apps import postgres_context
173
+
174
+ # hashing a password...
175
+ hashed = postgres_context.hash("somepass", user="dbadmin")
176
+ print(hashed)
177
+ # > 'md578ed0f0ab2be0386645c1b74282917e7'
178
+
179
+ # verifying a password...
180
+ print(postgres_context.verify("somepass", hashed, user="dbadmin"))
181
+ # > True
182
+ print(postgres_context.verify("wrongpass", hashed, user="dbadmin"))
183
+ # > False
184
+
185
+ # forgetting the user will result in an error:
186
+ try:
187
+ postgres_context.hash("somepass")
188
+ except TypeError as err:
189
+ print(err)
190
+ # > user must be unicode or bytes, not None
191
+ ```
192
+
193
+ ## Roundup
194
+
195
+ The [Roundup Issue Tracker](http://www.roundup-tracker.org) has long
196
+ supported a series of different methods for encoding passwords.
197
+ The following contexts are available for reading Roundup password hash fields:
198
+
199
+ `roundup10_context`
200
+
201
+ This object should recognize all password hashes used by Roundup 1.4.16 and earlier:
202
+ [`ldap_hex_sha1`](passlib.hash.ldap_other.md) (the default),
203
+ [`ldap_hex_md5`](passlib.hash.ldap_other.md), [`ldap_des_crypt`](passlib.hash.ldap_crypt.md),
204
+ and [`roundup_plaintext`](passlib.hash.plaintext.md).
205
+
206
+ `roundup15_context`
207
+
208
+ Roundup 1.4.17 adds support for [`ldap_pbkdf2_sha1`](passlib.hash.ldap_pbkdf2_digest.md)
209
+ as its preferred hash format.
210
+ This context supports all the `roundup10_context` hashes,
211
+ but adds that hash as well (and uses it as the default).
212
+
213
+ `roundup_context`
214
+
215
+ This is an alias for the latest version-specific roundup context supported
216
+ by passlib, currently the `roundup15_context`.
217
+
218
+ ## Custom Applications
219
+
220
+ `custom_app_context`
221
+
222
+ This `CryptContext` object is provided for new python applications
223
+ to quickly and easily add password hashing support.
224
+ It comes preconfigured with:
225
+
226
+ - Support for [`sha256_crypt`](passlib.hash.sha256_crypt.md) and [`sha512_crypt`](passlib.hash.sha512_crypt.md)
227
+ - Defaults to SHA256-Crypt under 32 bit systems, SHA512-Crypt under 64 bit systems.
228
+ - Large number of `rounds`, for increased time-cost to hedge against attacks.
229
+
230
+ For applications which want to quickly add a password hash,
231
+ all they need to do is import and use this object, per the
232
+ [usage example](#usage-example) at the top of this page.
233
+
234
+ !!! tip
235
+ See the [`quickstart`](../guide/quickstart.md) for additional details.